Development container
Development container that can be used with VSCode.
It works on Linux, Windows (WSL2) and OSX.
Requirements
- VS code installed
- VS code dev containers extension installed
- Docker installed and running
Setup
-
Create the following files on your host if you don't have them:
touch ~/.gitconfig ~/.zsh_history -
For OSX hosts: ensure your home directory
~is accessible by Docker. -
Open the command palette in Visual Studio Code (CTRL+SHIFT+P).
-
Select
Dev-Containers: Open Folder in Container...and choose the project directory.
Customization
For customizations to take effect, you should "rebuild and reopen":
- Open the command palette in Visual Studio Code (CTRL+SHIFT+P)
- Select
Dev-Containers: Rebuild Container
Customizations available are notably:
-
Changes to the Docker image in Dockerfile
-
Changes to VSCode settings and extensions in devcontainer.json.
-
Change the entrypoint script by adding in devcontainer.json a bind mount to a shell script to
/root/.welcome.shto replace the current welcome script. For example:{ "source": "/yourpath/.welcome.sh", "target": "/root/.welcome.sh", "type": "bind" }, -
More customizations available are documented in the devcontainer.json reference.