NAV Navbar
Logo
Switch version:

GoCD elastic agent images

GoCD elastic agents run inside Docker containers on an ECS cluster. You can either use the Docker images provided by the GoCD team or build your own images with the right software already provisioned on it.

Using your own docker image with elastic agents

The plugin executes the equivalent of the following docker command to start the agent:

$ docker run -e GO_EA_SERVER_URL=...
           -e GO_EA_AUTO_REGISTER_KEY=...
           -e GO_EA_AUTO_REGISTER_ENVIRONMENT=...
           -e GO_EA_AUTO_REGISTER_ELASTIC_AGENT_ID=...
           -e GO_EA_AUTO_REGISTER_ELASTIC_PLUGIN_ID=...
           ...
           IMAGE_ID

Your docker image is expected to contain a bootstrap script (to be executed via docker’s CMD) that will create an autoregister.properties file using these variables. The GO_EA_SERVER_URL will point to the server url that the agent must communicate with.

Here is an example shell script to do this —

# write out autoregister.properties
$ (
    cat <<EOF
    agent.auto.register.key=${GO_EA_AUTO_REGISTER_KEY}
    agent.auto.register.environments=${GO_EA_AUTO_REGISTER_ENVIRONMENT}
    agent.auto.register.elasticAgent.agentId=${GO_EA_AUTO_REGISTER_ELASTIC_AGENT_ID}
    agent.auto.register.elasticAgent.pluginId=${GO_EA_AUTO_REGISTER_ELASTIC_PLUGIN_ID}
    EOF
  ) > /var/lib/go-agent/config/autoregister.properties

The default bootstrap script used by the provided GoCD images can be found here.