Test go programs in a Linux container.
The fstab/go image contains a go build environment and can be used to compile, run, and test go applications in a Linux container.
If the GOPATH
environment variable is set correctly on the host system, fstab/go can be run as follows:
docker run -v $GOPATH:/home/go -t -i fstab/go
This will pull the image from docker hub, start the container, and launch a shell with the go
command available and the GOPATH
mapped to /home/go
.
-
Clone fstab/docker-go from GitHub.
git clone https://github.com/fstab/docker-go.git
-
Build the docker image
cd docker-go docker build -t="fstab/go" .
-
Run with the same command as described above.
docker run -v $GOPATH:/home/go -t -i fstab/go