Development containers, or dev containers, are Docker containers that are specifically configured to provide a fully featured development environment.
In order to get started, you need to satisfy the following prerequisites:
It is recommended you allocate at least 2GB of memory to Docker.
Clone the repository and follow the steps below to start developing in a devcontainer.
For most people getting started with development, the best solution is to use VSCode Remote - Containers extension.
VSCode should automatically suggest installing the required extensions. They can also be installed manually as follows:
- Install Remote - Containers for VSCode
- through command line code --install-extension ms-vscode-remote.remote-containers
- clicking on the Install button in the Vistual Studio Marketplace: Remote - Containers
- View: Extensions command in VSCode (Windows: CtrlShiftX; macOS: Cmd (⌘)ShiftX) then search for extension
ms-vscode-remote.remote-containers.
After the extension is installed, you can:
- Open the repository in VSCode
code .
Launch the following command from Command Palette (Windows: CtrlShiftP, macOS: Cmd (⌘)+Shift+X) Remote-Containers: Reopen in Container.
You can also click the green button in the bottom left corner to access the remote container menu.
Note
The first time you open the repository in a devcontainer, it will take some time to build the container. Subsequent openings will be faster.
Tip
The repository will be mounted and available in the container.
If you prefer not to use VSCode, you can still run the container manually to get a shell into the container. First, install the devcontainer CLI
npm install -g devcontainer-cliThen, run the following command in the root of the repository.
devcontainer up --workspace-folder .Finally, to get a shell in the container, run the following command.
devcontainer exec --workspace-folder . bash # (or zsh, depending on your shell preference)