A docker image containing a Golang environment for builds
- golang
- git
- gcc
- bash
- curl
- zip
- ssh
- subversion (some builds need this)
docker build . --pull --no-cache --platform linux/amd64 -t gocddev/golang-build:SNAPSHOT -f Dockerfile
Start the container with this:
docker run -d -e GO_SERVER_URL=... gocddev/golang-build:SNAPSHOT
docker run -d \
-e AGENT_AUTO_REGISTER_KEY=... \
-e AGENT_AUTO_REGISTER_RESOURCES=... \
-e AGENT_AUTO_REGISTER_ENVIRONMENTS=... \
-e AGENT_AUTO_REGISTER_HOSTNAME=... \
gocddev/golang-build:4.0.0
If the AGENT_AUTO_REGISTER_*
variables are provided (we recommend that you do), then the agent will be automatically approved by the server. See the auto registration docs on the GoCD website.
Pushing the built image to Docker Hub for use in build.gocd.org builds under the ecs-golang-build
elastic agent profile:
- Login to Docker hub with an account that has push token/credentials for the gocddev organisation
- Run
VERSION=4.0.11 docker tag gocddev/golang-build:SNAPSHOT gocddev/golang-build:${VERSION} docker push gocddev/golang-build:${VERSION}