Sign inSign up

frankyuen/common-devcontainer

By frankyuen

•Updated about 4 years ago

Common Development Container

Image
0

252

frankyuen/common-devcontainer repository overview

⁠Common DevContainer

⁠What is Common DevContainer

Common DevContainer is a Docker container to be used with Visual Studio Code Remote - Containers⁠ extension for developing software inside a Docker container

Microsoft builds and maintains development containers⁠ to support a range of programming languages and runtimes, individually. This project integrates several common and popular languages and runtimes into a single development container

The latest version of this project supports the following languages:

  • Python 3.10.7
  • Go 1.18.6
  • Node.js 16.17.1 (NPM 8.15.0)

⁠How to build a Common DevContainer

  1. Checkout the source code of this repository⁠
  2. Change directory to .devcontainer
  3. Build the image:
    docker build -t <yourContainerRegistry>/<yourImage>:<yourTag> .
    

⁠How to use a built DevContainer

The fastest and easiest way to use Common DevContainer is to create the file devcontainer.json in the .devcontainer, which should be at the root of your project path, then open the project in VS Code. VS Code would then prompt you to reopen the project in a remote container

The detail steps are as follows:

  1. Go to your project root directory, for example: cd /path/to/myProjectDir/

  2. Create the .devcontainer directory:

    mkdir .devcontainer
    
    cd .devcontainer
    
  3. Create a file named devcontainer.json inside the directory .devcontainer

  4. Copy or customize the content from the sample file⁠ to your version of devcontainer.json

  5. Open the project directory in VS Code:

    code /path/to/myProjectDir/
    
  6. VS Code would detect there is a .devcontainer/devcontainer.json file in your project directory and would prompt you to reopen the project in a development container

  7. If you do not see the above prompt, run the Remote-Containers: Open Folder in Container... command from the Command Palette (F1)

  8. You are all set. You may open the terminal to operate the files inside the container

⁠A couple of points to note
  • You may customize the actual Docker image to use in .devcontainer/devcontainer.json
  • By default, VS Code will automatically "bind" mount your current workspace folder into the container. Again, you may customize the relevant settings⁠ in .devcontainer/devcontainer.json

Tag summary

Content type

Image

Digest

sha256:222e1aba7…

Size

833.2 MB

Last updated

about 4 years ago

docker pull frankyuen/common-devcontainer