Skip to content

gocd-contrib/docker-golang-image

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker-golang-image

A docker image containing a Golang environment for builds

Includes everything needed to build a basic golang project

  • golang (based on the official golang alpine image)
  • git
  • gcc
  • bash

And some some extra utils that are useful:

  • curl
  • zip
  • ssh
  • subversion (some builds need this)

Building the image locally

docker build . --pull --no-cache --platform linux/amd64 -t gocddev/golang-build:SNAPSHOT -f Dockerfile

Running

Start the container with this:

docker run -d -e GO_SERVER_URL=... gocddev/golang-build:SNAPSHOT

Auto-registering the agents

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.

Development

Pushing the built image to Docker Hub for use in build.gocd.org builds under the ecs-golang-build elastic agent profile:

  • Configure Docker with with godemo push token/credentials for the gocddev organisation
  • Run
    VERSION=4.0.11
    docker tag gocddev/golang-build:SNAPSHOT gocddev/golang-build:${VERSION}
    docker --config ../.docker-godemo push gocddev/golang-build:${VERSION}

About

A docker image containing a Golang environment for builds

Resources

License

Stars

Watchers

Forks

Packages

No packages published