{"id":18649860,"url":"https://github.com/ashwanthkumar/docker-gocd-agent","last_synced_at":"2026-01-25T00:32:43.830Z","repository":{"id":140449951,"uuid":"52206258","full_name":"ashwanthkumar/docker-gocd-agent","owner":"ashwanthkumar","description":"Fork of travix/gocd-agent but available on public","archived":false,"fork":false,"pushed_at":"2016-02-23T17:58:12.000Z","size":5,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-17T20:36:32.852Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ashwanthkumar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-02-21T12:50:39.000Z","updated_at":"2016-02-23T17:58:44.000Z","dependencies_parsed_at":"2023-05-07T04:13:28.455Z","dependency_job_id":null,"html_url":"https://github.com/ashwanthkumar/docker-gocd-agent","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ashwanthkumar/docker-gocd-agent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashwanthkumar%2Fdocker-gocd-agent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashwanthkumar%2Fdocker-gocd-agent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashwanthkumar%2Fdocker-gocd-agent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashwanthkumar%2Fdocker-gocd-agent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ashwanthkumar","download_url":"https://codeload.github.com/ashwanthkumar/docker-gocd-agent/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ashwanthkumar%2Fdocker-gocd-agent/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28739876,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-24T22:12:27.248Z","status":"ssl_error","status_checked_at":"2026-01-24T22:12:10.529Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T06:40:54.352Z","updated_at":"2026-01-25T00:32:43.811Z","avatar_url":"https://github.com/ashwanthkumar.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Usage\nTo run this docker container use the following command\n```\ndocker run -d ashwanthkumar/gocd-agent:latest\n```\n\n# Environment variables\nIn order to configure the agent for use in your cluster with other than default settings you can pass in the following environment variables\n\n| Name  |\tDescription |\tDefault value |\n| --- | --- | --- |\n| GO_SERVER |\tThe host name or ip address of the server to connect to\t| localhost |\n| GO_SERVER_PORT  |\tThe http port of the go server  |\t8153  |\n| AGENT_MEM |\tThe -Xms value for the java vm\t|  128m  |\n| AGENT_MAX_MEM\t| The -Xmx value for the java vm  |\t256m  |\n| AGENT_KEY |\tThe secret key set on the server for auto-registration of the agent\t| |\n| AGENT_RESOURCES |\tThe resource tags for the agent in case of auto-registration  | |\n| AGENT_ENVIRONMENTS  |\tThe environments the agent is assigned to in case of auto-registration  | |\n| AGENT_HOSTNAME  |\tThe hostname used for the agent; normally it's the hosts actual hostname\t|  |\n| AGENT_GUID  | GUID of the agent; normally it is left blank and auto-generated by the server\t|  |\n| DOCKER_GID_ON_HOST  |\tTo mount docker socket and use it without sudo the go user needs to be added to the docker group; pass in the gid from the guest os with this variable  | |\n\nTo connect the agent to your server with other than default ip or hostname\n\n```\ndocker run -d \\\n    -e \"GO_SERVER=gocd.yourdomain.com\" \\\n    ashwanthkumar/gocd-agent:latest\n```\n\nIf you've set up your server for autoregistration of agents pass in the same value for environment variable `AGENT_KEY` when starting the agent\n\n```\ndocker run -d \\\n    -e \"GO_SERVER=gocd.yourdomain.com\" \\\n    -e \"AGENT_KEY=388b633a88de126531afa41eff9aa69e\" \\\n    ashwanthkumar/gocd-agent:latest\n```\n\nYou can also set resource tags, gocd environment and hostname for the agent when autoregistering\n\n```\ndocker run -d \\\n    -e \"GO_SERVER=gocd.yourdomain.com\" \\\n    -e \"AGENT_KEY=388b633a88de126531afa41eff9aa69e\" \\\n    -e \"AGENT_RESOURCES=deploy-x,deploy-z\" \\\n    -e \"AGENT_ENVIRONMENTS=Production\" \\\n    -e \"AGENT_HOSTNAME=deploy-agent-01\" \\\n    ashwanthkumar/gocd-agent:latest\n```\n\nTo mount docker socket and be able to use it sudo-less inside the container use the following\n\n```\ndocker run -d \\\n    -e \"GO_SERVER=gocd.yourdomain.com\" \\\n    -e \"DOCKER_GID_ON_HOST=$(getent group docker | cut -d: -f3)\" \\\n    -v /var/run/docker.sock:/var/run/docker.sock \\\n    -v /usr/bin/docker:/usr/bin/docker \\\n    ashwanthkumar/gocd-agent:latest\n```\n\nDo be aware that mounting docker inside your container poses a large security risk as the container indirectly has access to the whole machine in this way.\n\n# Mounting volumes\nIn order to keep working copies over a restart and use ssh keys from the host machine you can mount the following directories\n\n| Directory |\tDescription |\tImportance  |\n| --- | --- | --- |\n| /var/lib/go-agent/pipelines |\tThis directory holds the working copies for all pipelines that have run on this agent | You want to have this cleaned up regularly anyway, so no real need to mount it  |\n| /var/log/go-agent |\tAll output logs go here, but there also written to standard out in the container  |\tPreferably collect logs from standard out |\n| /var/go/.ssh  |\tThe ssh keys to connect to version control systems like github and bitbucket  |\tAs it's better not to embed these keys in the container you likely need to mount this |\n| /var/run/docker.sock  |\tTo mount the docker socket of the guest os  |\tNote: mounting this is a security risk! |\n| /usr/bin/docker |\tTo mount the docker binary of the guest os  |\tNote: mounting this is a security risk! |\n\nStart the container like this to mount the directories\n\n```\ndocker run -d \\\n    -e \"GO_SERVER=gocd.yourdomain.com\" \\\n    -e \"AGENT_KEY=388b633a88de126531afa41eff9aa69e\" \\\n    -e \"AGENT_RESOURCES=deploy-x,deploy-z\" \\\n    -e \"AGENT_ENVIRONMENTS=Production\" \\\n    -e \"AGENT_HOSTNAME=deploy-agent-01\" \\\n    -v /mnt/persistent-disk/gocd-agent/pipelines:/var/lib/go-agent/pipelines\n    -v /mnt/persistent-disk/gocd-agent/logs:/var/log/go-agent\n    -v /mnt/persistent-disk/gocd-agent/ssh:/var/go/.ssh\n    -v /var/run/docker.sock:/var/run/docker.sock \\\n    -v /usr/bin/docker:/usr/bin/docker \\\n    ashwanthkumar/gocd-agent:latest\n```\n\nTo make sure the process in the container can read and write to those directories create a user and group with same gid and uid on the host machine\n\n```\ngroupadd -r -g 999 go\nuseradd -r -g go -u 999 go\n```\n\nAnd then change the owner of the host directories\n\n```\nchown -R go:go /mnt/persistent-disk/gocd-agent/pipelines\nchown -R go:go /mnt/persistent-disk/gocd-agent/ssh\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashwanthkumar%2Fdocker-gocd-agent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fashwanthkumar%2Fdocker-gocd-agent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fashwanthkumar%2Fdocker-gocd-agent/lists"}