DevDock is a VS Code extension for managing Docker-based development environments.
Features
Create and manage Docker containers for development.
Simplified workflows for building, running, and debugging code in isolated environments.
Installation
Download the extension from the VS Code Marketplace.
Install using the Extensions view in Visual Studio Code.
Usages
How to Use the VSCode Extension
Create an Empty Directory and Open It in VSCode
Start by creating a new empty directory.
Open the directory in VSCode.
Create a File with Your Desired Programming Language Extension
Example: main.py for Python.
Select the File in the Sidebar and Run devdock.run
Use the shortcut: Cmd (Ctrl) + Shift + Alt + R.
A {language}.Dockerfile is Automatically Generated
For Python, this would be python.Dockerfile:
FROM python:3.12-alpine
COPY . /app
COPY requirements.txt /app
WORKDIR /app
RUN pip install --no-cache-dir -r requirements.txt
EXPOSE 8080 80
EXPOSE 443
VOLUME /data
VOLUME /data /tmp # The second "/data" will be ignored as it's duplicated
VOLUME [ "/data" ] # This "/data" will also be ignored due to duplication
VOLUME [ "/data", "/tmp2" ] # Only "/tmp2" is added as "/data" is redundant
CMD ["python3", "main.py"]
Modify the Generated Files as Needed for Your Development Environment
When using the EXPOSE keyword, ports will be automatically mapped to random ports during execution: