{"id":26878896,"url":"https://github.com/logicify/docker-teamcityagent-common","last_synced_at":"2026-02-02T03:36:05.337Z","repository":{"id":34103089,"uuid":"37930380","full_name":"Logicify/docker-teamcityagent-common","owner":"Logicify","description":"Java 8 + Teamcity agent + docker client + nodejs + python + maven","archived":false,"fork":false,"pushed_at":"2019-07-16T09:37:43.000Z","size":23301,"stargazers_count":0,"open_issues_count":0,"forks_count":5,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-31T12:36:42.804Z","etag":null,"topics":["docker-teamcity","teamcity"],"latest_commit_sha":null,"homepage":null,"language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Logicify.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-23T16:20:25.000Z","updated_at":"2019-07-16T09:39:18.000Z","dependencies_parsed_at":"2022-07-29T20:09:50.934Z","dependency_job_id":null,"html_url":"https://github.com/Logicify/docker-teamcityagent-common","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/Logicify/docker-teamcityagent-common","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Logicify%2Fdocker-teamcityagent-common","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Logicify%2Fdocker-teamcityagent-common/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Logicify%2Fdocker-teamcityagent-common/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Logicify%2Fdocker-teamcityagent-common/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Logicify","download_url":"https://codeload.github.com/Logicify/docker-teamcityagent-common/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Logicify%2Fdocker-teamcityagent-common/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261987979,"owners_count":23240941,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["docker-teamcity","teamcity"],"created_at":"2025-03-31T12:30:24.528Z","updated_at":"2026-02-02T03:36:04.194Z","avatar_url":"https://github.com/Logicify.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Teamcity Build Agent (common)\n\n*Version: 2017.2.1*, *Last update date: 2018-01-23*\n\nThis image provides teamcity build agent which might be connected to teamcity server instance. Because of Teamcity architecture actual build process will be performed by build agent which means that in case of dockerized environment build scripts will be launched **inside** container. \n\n__NOTE__: It is highly recommended to keep Teamcity Server and agent versions in sync. While it is possible to use __older__ version of agent with newer version of Teamcity this setup is not recommended as it will cause agent update on each new agent container provisioning.\n\n## Contents\n\nAlong with agent itself this image contains a few set of software widely used in typical build chains. Table below contains the main packages and theirs versions:\n\n| Package                                  | Version  | Description                              |\n| ---------------------------------------- | -------- | ---------------------------------------- |\n| Teamcity Build Agent                     | 2017.2.1 | Build agent itself                       |\n| [NodeJS](https://nodejs.org/)            | 8.9.4    | Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine. Includes NPM - the default package manager. |\n| [Grunt](https://gruntjs.com/)            | latest   | JavaScript task runner, a tool used to automatically perform frequent tasks such as minification, compilation, unit testing, and linting. |\n| [Gulp](https://gulpjs.com/)              | latest   | Streaming build system for front-end web development |\n| Karma                                    | latest   |                                          |\n| [Yarn](https://yarnpkg.com/)             | latest   | Fast, reliable, and secure dependency management for NodeJS. |\n| [Maven](https://maven.apache.org/)       | 3.5.2    | Maven is a build automation tool used primarily for Java projects. |\n| [Docker](https://www.docker.com/)        | latest   |                                          |\n| [docker-compose](https://docs.docker.com/compose/) | latest   | Compose is a tool for defining and running multi-container Docker applications |\n| [JQ](https://stedolan.github.io/jq/)     | latest   | Very high-level functional programming language with support for backtracking and managing streams of JSON data. Something like **sed** for JSON. |\n| awscli                                   | latest   |                                          |\n| subversion                               | latest   |                                          |\n| git                                      | latest   |                                          |\n\n\\* __latest__ version means the recent stable version in repositories available on the moment of image build.\n\n## Technical Information\n\n### Base Images\n\n**OS**: [Centos 7](https://www.centos.org/)\n\nParent Image Chain:\n\n* [logicify/java8:latest](https://hub.docker.com/r/logicify/java8/)\n* [logicify/centos7:latest](https://hub.docker.com/r/logicify/centos7/)\n\n### Exposed Ports\n\n| Port | Description                              |\n| ---- | ---------------------------------------- |\n| 9090 | The port used for communication between TeamCity server and Agent. It is required to make sure that Teamcity could establish network connection with agent on this port. |\n\n### Exposed Volumes\n\n| Path                     | Description                              |\n| ------------------------ | ---------------------------------------- |\n| /srv/teamcity-agent/conf | The directory contains Teamcity agent configuration files. You might consider mapping this volume in case you need to tweak configuration manually. |\n\n## Usage\n\nBelow is basic configuration for deploying teamcity server and agent on the same machine:\n\n```yaml\nteamcity:\n  image: logicify/teamcity:latest\nagent1:\n  image: logicify/teamcityagent-common:latest\n  links:\n    - teamcity\n  environment:\n    AGENT_NAME: agent1    \n```\n\nFor real setup you might need to specify `TEAMCITY_SERVER_URL` and make sure that server and agent are able to maintain network link.\n\nBelow is a full list of supported environment variables:\n\n| Variable            | Default value | Description                              |\n| ------------------- | ------------- | ---------------------------------------- |\n| TEAMCITY_SERVER_URL | teamcity      | url pointing teamcity server installation |\n| AGENT_PORT          | 9090          | Agent own port number to be occupied by agent |\n| AGENT_NAME          | default-agent | Agent name to be used for agent identification. It will be visible in teamcity control panel. |\n\n### Configuring for building docker images\n\nNowadays it is pretty common to build docker images as a part of continuous integration process. However from the technological standpoint it might be tricky as you need to use docker from the inside of docker container. It is impossible to run docker server inside docker container, however you can leverage docker's client-server architecture and point docker client from this agent container to the external docker server instance. \n\nIn order to configure this setup you need to set `DOCKER_HOST` environment variable to point docker server accessible from the container. There are multiple options how to achieve this. We describe a few below, however you should be careful in your choices and **consider security implications** before implementation.\n\n#### Option 1. Share docker server from  your host.\n\nYou can simply grand access to the docker server of the machine you use to run this container with build agent. This is the easiest configuration possible **BUT it is also the most dangerous one**! It means that your agent will have FULL access on the containers running on the machine including own container and also other containers on the same machine. **Please think twice before doing this and ensure you understand the risks**. In general this might be a good option if you do not run anything critical on the same machine with your agent and you are not able to setup more complicated configuration.\n\n1. Make sure you docker daemon on host machine is configured to expose tcp interface. Please refer official docker documents for details. Below is an example of `daemon.conf` which enables socket interface along with tcp for docker network only:\n\n   ```json\n   {\n     \"hosts\": [\"tcp://172.17.0.1:2375\", \"unix:///var/run/docker.sock\"]\n   }\n   ```\n\n2. Configure agent to use DOCKER_HOST:\n\n   ```yaml\n   agent1:\n     image: logicify/teamcityagent-common:latest\n     links:\n       - teamcity\n     environment:\n       AGENT_NAME: agent1\n       DOCKER_HOST: 172.17.0.1\n   ```\n\nAlternatively you can mount unix socket as a volume, but in this case you should ensure the user running docker agent has write permissions on that file. \n\n#### Option 2. Setup another docker daemon instance on the host\n\nAn  idea is very similar to the previous one but it allows to __address some__ of the security risks - your build agent will not be able to kill or brake another containers (own neighbors).\n\nJust configure you host machine to run 2 docker daemons and use the first one for running containers and the second one exclusively for building images.  \n\nNote there is still a non addressed security risk - your build agent along with building, pushing and pulling images might also **run** new containers and generally do whatever is possible with docker daemon (full access).\n\n#### Option 3. Setup separate docker daemon with http interface behind proxy\n\nAn idea is the similar to the prev. one but we add http proxy (e.g. nginx) to limit allowed api calls to `BUILD`, `PULL`, `PUSH`, `TAG`, `AUTH`. Below is simple nginx config which might do the trick:\n\n```nginx\nupstream docker-backend {\n    server 127.0.0.1:2375;\n}\n\nserver {\n    listen 9180;\n    server_name dockerbuilder;\n\n    location ~* /(v[\\\\.\\d]+/)?(images|build|auth)/?.* {\n      proxy_pass http://127.0.0.1:2375;\n    }\n\n    location / {\n      deny all;\n    }\n}\n\nserver {\n    listen 9443 ssl;\n    server_name dockerbuilder;\n    include ssl.conf;\n    include proxy.conf;\n\n    location ~* /(v[\\\\.\\d]+/)?(images|build|auth)/?.* {\n      proxy_pass http://docker-backend;\n    }\n\n    location / {\n      deny all;\n    }\n}\n```\n\nKeep in mind that `DOCKER_HOST` variable passed to the container should point nginx port, not original docker. In this example it should be `9180` or `9443` for ssl.\n\n## Credits\n\nThis image was originally built by Dmitry Berezovsky (Logicify). The list of maintainers is below:\n\n* Dmitry Berezovsky (d@logicify.com)\n* Kirill Vyborny (kirill.vyborny@logicify.com)\n\n## Contribution\n\nThis image is connected to the [Docker Cloud](https://cloud.docker.com) automated builds and configured to rebuild images on each push to the repository. It should **automatically** pick changes from **any** repository tag. In that case it will build from repository tag, assign the same docker image tag and change `latest` to point the recent build. In order to build image from the `mater` branch it is required to trigger build manually via [Docker Cloud Console](https://cloud.docker.com/app/logicify/repository/). ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flogicify%2Fdocker-teamcityagent-common","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flogicify%2Fdocker-teamcityagent-common","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flogicify%2Fdocker-teamcityagent-common/lists"}