See [release notes](https://github.com/qdm12/godevcontainer/releases/tag/v0.21.0) Notably: - Go upgraded from 1.23 to 1.25 - golangci-lint upgraded to v2.4.0 - Alpine upgraded from 3.20 to 3.22 - Disable package comment requirement by gopls' staticcheck - Pull container image from ghcr.io
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 and directory on your host if you don't have them:
touch ~/.gitconfig ~/.zsh_history mkdir -p ~/.ssh -
For OSX hosts: ensure the project directory and your home directory
~are 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 any customization to take effect, you should "rebuild and reopen":
- Open the command palette in Visual Studio Code (CTRL+SHIFT+P)
- Select
Dev-Containers: Rebuild Container
Changes you can make are notably:
-
Changes to the Docker image in Dockerfile
-
Changes to VSCode settings and extensions in devcontainer.json.
-
Change the entrypoint script by adding a bind mount in devcontainer.json of a shell script to
/root/.welcome.shto replace the current welcome script. For example:// Welcome script { "source": "/yourpath/.welcome.sh", "target": "/root/.welcome.sh", "type": "bind" }, -
More options are documented in the devcontainer.json reference.