/dev-container-go

A container for developing in Go

Primary LanguageShellMIT LicenseMIT

dev-container-go

Docker Hub

A container, based on dev-container-base, for developing in Go.

Usage

The base container starts an SSH server, so you can read more about that in its README. This container assumes that your GOPATH will be /home/dev/gopath. You'll probably want to volume mount a directory for this, so your changes are easy to get to if you shut down the container.

I usually start it with something like (assuming $GOPATH is ~/gopath):

docker run -d \
  -e AUTHORIZED_GH_USERS="dpetersen" \
  -p 0.0.0.0:31981:22 \
  -v ~/gopath:/home/dev/gopath \
  dpetersen/dev-container-go:latest

There is a bootstrapping script you can run with /home/dev/run_once.sh that will bootstrap a GOPATH hierarchy and install a few development tools. If you have volume mounted an existing GOPATH, this won't smash it.

I'd advise you to set up an SSH alias as explained here.

Development

Helpful reminders on how to build, tag, and push this can be found in the Development section of the other image.