DockerGenie is a Visual Studio Code extension that leverages the power of OpenAI's GPT-3.5-turbo to automatically generate Dockerfiles. This AI-powered tool simplifies the process of Dockerizing your applications.
- Automatically generate Dockerfiles using AI.
- User-friendly interaction with GPT-3.5-turbo for custom Dockerfile content.
- Supports various configurations for Dockerfile generation.
- Open Visual Studio Code
- Press
Ctrl+P
to open the Quick Open dialog - Type
ext install your-vscode-namespace.docker-genie
into the textbox and press enter - Reload Visual Studio Code
Replace
your-vscode-namespace
with your actual Visual Studio Code namespace.
To generate a Dockerfile:
-
Press
Ctrl+Shift+P
(orCmd+Shift+P
on macOS) to open the Command Palette. -
Type "Generate Dockerfile" and hit enter.
-
An Input box will appear. Here, you are supposed to provide your specific requirements for the Dockerfile.
You need to describe your application's environment, such as the programming language, framework, version, and any special setup you need. DockerGenie will use this information to instruct the GPT-3.5-turbo model for generating your Dockerfile.
For example, if you are developing a Python 3 application using Flask framework, you could type in something like: "Python 3 application using Flask framework. I need to include gunicorn as my WSGI HTTP server." After you finish, hit enter.
The DockerGenie will then communicate with the GPT-3.5-turbo model and come up with a Dockerfile that suits your needs.
Remember that the more specific and detailed you are in your description, the more accurate your generated Dockerfile will be.
Let's say we want to generate a Dockerfile for a Python 3 application with Flask. Here's how you can do it:
- Press
Ctrl+Shift+P
to open the Command Palette. - Type "Generate Dockerfile" and hit enter.
- In the Input box, type "Python 3 application with Flask and Gunicorn" and hit enter.
Voila! DockerGenie generates a Dockerfile as per your specifications:
# Base Image
FROM python:3
# Install Flask and Gunicorn
RUN pip install flask gunicorn
# Copy the application
COPY app.py /app/
# Set the working directory
WORKDIR /app
# Set the Flask app environment variable
ENV FLASK_APP=app.py
# Expose the application on port 5000
EXPOSE 5000
# Run the application
CMD ["gunicorn", "-b", "0.0.0.0:5000", "app:app"]
We appreciate your contributions! Whether it's a bug report, new feature, correction, or additional documentation, we welcome your issues and pull requests.
- If you find a bug or want a new feature, please create an issue.
- If you want to contribute, please feel free to create a pull request.
This project is licensed under the terms of the MIT license.
Happy Dockerizing with DockerGenie