Docker management with VS Code

I want to manage the development environment with Docker and code with VS Code For that purpose, I described the series of flow investigated and the operation of Docker on VS Code.


Windows 10 Home: 2004 VSCode: 1.49.2 Docker: 19.03.12

Remote Development installation

Launch VS Code, search for ** Remote Development ** with extensions and install

Creating an execution environment

The file structure in development using Remote Development looks like this.

├ .devcontainer
 ├ devcontainer.json
 └ Dockerfile
└ Contents

Located in the **. Devcontainer ** folder directly under the project It's like describing the settings related to the container in ** devcontainer.json ** and ** Dockerfile **. In the example, the Python environment is written in Refer here.

  ├ devcontainer.json
  └ Dockerfile
├ requirements.txt


# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See for license information.

FROM python:3


    "name": "Python 3",
    "context": "..",
    "dockerFile": "Dockerfile",

    "settings": { 
        "": "/bin/bash",
        "python.pythonPath": "/usr/local/bin/python",
        "python.linting.enabled": true,
        "python.linting.pylintEnabled": true,
        "python.linting.pylintPath": "/usr/local/bin/pylint"

    "appPort": [ 9000 ],

    "postCreateCommand": "pip install -r requirements.txt",

    "extensions": ["ms-python.python"]




Create / start container

Click ** [> <] ** at the bottom left, then select ** Remote-Containers: Open Folder in Container… **, and ** Select the project described earlier (Docker Python in the example) ** to launch the container. (It will take some time) When the project is successfully launched, try running ** python ** and ** pip freeze ** in your terminal.

/workspaces/DockerPython# python
/workspaces/DockerPython# pip freeze

If it becomes as above, it is done properly.

Get out of the container

Click ** [> <] ** at the bottom left again, then select ** End Remote Connection ** Then you can get out of the container. The container also stops.

Re-enter the container

Click ** Remote Explorer ** on the bar created when installing Remote Development Click the previous project from the list that appears after that. Click ** Open Contaner ** at the end of the file that appears after that. Click, and the container will restart and you can re-enter.

Delete container

Click ** Remote Explorer ** after exiting the container Right-click on the project you want to delete and click ** Remove Container ** in the menu that appears. Then the container will be deleted

Docker extension

There is ** Docker ** as an extension of VS Code. Remote Development is sufficient to create an execution environment Docker ** responds well and displays images **, so for container management I think it's good to put it together.


If you use Remote Development, you can develop in Docker environment with VS Code It was nice to be able to operate Docker without typing commands.


Recommended Posts

Docker management with VS Code
Getting Started with Docker with VS Code
Lombok with VS Code
Run VS Code on Docker
Format Ruby with VS Code
Hello World with VS Code!
Build Java development environment with WSL2 Docker VS Code
Spring Boot programming with VS Code
Java build with mac vs code
Summary of steps for developing in Docker container with VS Code
Try using Spring Boot with VS Code
Building a haskell environment with Docker + VS Code on Windows 10 Home
Using Gradle with VS Code, build Java → run
Create Spring Boot environment with Windows + VS Code
Try debugging a Java program with VS Code
Build a Java development environment with VS Code
Connect with VS Code from a Windows client to Docker on another server
Launch MariaDB with Docker
Rails deploy with Docker
Run Pico with docker
Explode Docker with WSL2
Use Puphpeteer with Docker
Operate Emby with Docker
Try WildFly with Docker
Use ngrok with Docker
Run Payara with Docker
[Docker] Connection with MySQL
Php settings with Docker
Getting Started with Docker
Disposable PHP with Docker
Install Composer with Docker
Build Java development environment with VS Code on Mac
Build ruby debug environment with VS Code of Windows 10
Introduce JavaFX 15 and do GUI development with VS Code
How to build Java development environment with VS Code
[Environment construction] Build a Java development environment with VS Code!
Beginners create Spring Tools Suite environment with VS Code
Link Docker log to AWS CloudWatch and monitor in real time with VS Code
Until you build a Nuxt.js development environment with Docker and touch it with VS Code
Create a Java (Gradle) project with VS Code and develop it on a Docker container
Create a Java (Maven) project with VS Code and develop it on a Docker container
Pytorch execution environment with Docker
Use GDAL with Python with Docker
Deploy with EC2 / Docker / Laravel
Run TAO Core with Docker
Set up GitLab with docker
Create a VS Code Plugin.
Container management with ECS + CodePipline
Java web application development environment construction with VS Code (struts2)
Run Rails whenever with docker
Get started with DynamoDB with docker
Docker autostart settings with wsl2
[Docker] Rails 5.2 environment construction with docker
Spring Boot starting with Docker
Build docker environment with WSL
Version control CocoaPods with Docker
Web application built with docker (1)
Try debugging natural language processing on Windows. with VS Code
Reduce verbose code with Lombok
I tried BIND with Docker
A memo to start Java programming with VS Code (2020-04 version)