https://github.com/qdm12/godevcontainer
Golang development container for Visual Studio Code Remote Containers Development
https://github.com/qdm12/godevcontainer
devcontainer docker go golang remote-containers vscode
Last synced: 6 months ago
JSON representation
Golang development container for Visual Studio Code Remote Containers Development
- Host: GitHub
- URL: https://github.com/qdm12/godevcontainer
- Owner: qdm12
- License: mit
- Created: 2019-09-12T22:13:54.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2025-02-09T06:58:50.000Z (9 months ago)
- Last Synced: 2025-04-12T14:17:24.821Z (7 months ago)
- Topics: devcontainer, docker, go, golang, remote-containers, vscode
- Language: Dockerfile
- Homepage: https://hub.docker.com/r/qmcgaw/godevcontainer
- Size: 255 KB
- Stars: 272
- Watchers: 7
- Forks: 47
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
- awesome-devcontainers - Go Dev Container - Ultimate Go development container for Visual Studio Code. (Samples / Go)
README
# Go Dev Container
**Ultimate Go development container for Visual Studio Code**
[](https://hub.docker.com/r/qmcgaw/godevcontainer)
[](https://github.com/qdm12/godevcontainer/actions/workflows/alpine.yml)
[](https://github.com/qdm12/godevcontainer/actions/workflows/debian.yml)
[](https://hub.docker.com/r/qmcgaw/godevcontainer)

[](https://hub.docker.com/r/qmcgaw/godevcontainer/tags)

[](https://hub.docker.com/r/qmcgaw/godevcontainer/tags?page=1&ordering=last_updated)


[](https://github.com/qdm12/godevcontainer/commits/main)
[](https://github.com/qdm12/godevcontainer/graphs/contributors)
[](https://github.com/qdm12/godevcontainer/pulls?q=is%3Apr+is%3Aclosed)
[](https://github.com/qdm12/godevcontainer/issues)
[](https://github.com/qdm12/godevcontainer/issues?q=is%3Aissue+is%3Aclosed)
[](https://github.com/qdm12/godevcontainer)



## Features
- Compatible with `amd64`, `386`, `arm64`, `armv6` and `armv7` CPUs
- `qmcgaw/godevcontainer:alpine` and `qmcgaw/godevcontainer`
- Based on Alpine 3.20 (size of 996MB)
- `qmcgaw/godevcontainer:debian`
- Based on Debian Buster Slim (size of 1.21GB)
- Based on [qmcgaw/basedevcontainer](https://github.com/qdm12/basedevcontainer)
- Based on either Alpine or Debian
- Minimal custom terminal and packages
- See more [features](https://github.com/qdm12/basedevcontainer#features)
- Go 1.23 code obtained from the latest tagged Golang Docker image
- Go tooling [integrating with VS code](https://github.com/Microsoft/vscode-go/wiki/Go-tools-that-the-Go-extension-depends-on), all cross built statically from source at the [binpot](https://github.com/qdm12/binpot):
- [Google's Go language server gopls](https://github.com/golang/tools/tree/master/gopls)
- [golangci-lint](https://github.com/golangci/golangci-lint), includes golint and other linters
- [dlv](https://github.com/go-delve/delve/cmd/dlv) ⚠️ only works on `amd64` and `arm64`
- [gomodifytags](https://github.com/fatih/gomodifytags)
- [goplay](https://github.com/haya14busa/goplay)
- [impl](https://github.com/josharian/impl)
- [gotype-live](https://github.com/tylerb/gotype-live)
- [gotests](https://github.com/cweill/gotests)
- [gopkgs v2](https://github.com/uudashr/gopkgs/tree/master/v2)
- Terminal Go tools
- [mockgen](https://github.com/golang/mock) to generate mocks
- [mockery](https://github.com/vektra/mockery) to generate mocks for testify/mock
- Cross platform
- Easily bind mount your SSH keys to use with **git**
- Manage your host Docker from within the dev container, more details at [qmcgaw/basedevcontainer](https://github.com/qdm12/basedevcontainer#features)
- Extensible with docker-compose.yml
- Comes with extra Go binary tools for a few extra MBs: `kubectl`, `kubectx`, `kubens`, `stern` and `helm`
## Requirements
- [Docker](https://www.docker.com/products/docker-desktop) installed and running
- If you use OSX, share the `~/.ssh` directory and the directory of your project with Docker Desktop
- [Docker Compose](https://docs.docker.com/compose/install/) installed
- [VS code](https://code.visualstudio.com/download) installed
- [VS code dev containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) installed
## Setup for a project
1. Setup your configuration files
- With style 💯
```sh
docker run -it --rm -v "/yourrepopath:/repository" qmcgaw/devtainr:v0.2.0 -dev go -path /repository -name projectname
```
Or use the [built binary](https://github.com/qdm12/devtainr#binary)
- Or manually: download this repository and put the [.devcontainer](.devcontainer) directory in your project.
1. If you have a *.vscode/settings.json*, eventually move the settings to *.devcontainer/devcontainer.json* in the `"settings"` section as *.vscode/settings.json* take precedence over the settings defined in *.devcontainer/devcontainer.json*.
1. Open the command palette in Visual Studio Code (CTRL+SHIFT+P) and select `Dev Containers: Open Folder in Container...` and choose your project directory
## Customization
See the [.devcontainer/README.md](.devcontainer/README.md) document in your repository.
## TODOs
- [qmcgaw/basedevcontainer](https://github.com/qdm12/basedevcontainer) todos
## License
This repository is under an [MIT license](https://github.com/qdm12/godevcontainer/master/LICENSE) unless indicated otherwise.