Public Repository

Last pushed: 5 days ago
Short Description
TeamCity Minimal Build Agent
Full Description

TeamCity Minimal Build Agent

This is an official JetBrains TeamCity minimal build agent image.

TeamCity build agent connects to the TeamCity server and spawns the actual build processes.
You can use jetbrains/teamcity-server image to run TeamCity server.

This minimal image adds just TeamCity agent without any tools like VCS clients, etc. It is suitable for simple builds and can serve as a base for your custom images. For Java or .NET development we recommend to use default build agent image jetbrains/teamcity-agent.

Image Tags

All default tags in docker images refers to the Linux images. Windows docker images have suffixes -windowsservercore and -nanoserver:

  • jetbrains/teamcity-minimal-agent, jetbrains/teamcity-minimal-agent:latest (ubuntu)
  • jetbrains/teamcity-minimal-agent:latest-windowsservercore (windowsservercore)
  • jetbrains/teamcity-minimal-agent:latest-nanoserver (nanoserver)

Current Status

Experimental image, feedback is welcome.

How to Use This Image

Pull TeamCity minimal image from the Docker Hub Repository

jetbrains/teamcity-minimal-agent and

use the following command to start a container with TeamCity agent running inside Linux container:

docker run -it -e SERVER_URL="<url to TeamCity server>"  \ 
    -v <path to agent config folder>:/data/teamcity_agent/conf  \      
    jetbrains/teamcity-minimal-agent

or Windows container:

docker run -it -e SERVER_URL="<url to TeamCity server>" 
    -v <path to agent config folder>:C:/BuildAgent/conf      
    jetbrains/teamcity-minimal-agent:latest-nanoserver

where
<url to TeamCity server> - is full URL for TeamCity server, accessible by the agent. Note that "localhost" will not generally not work as that will refer to the "localhost" inside the container.
<path to agent config folder> - is the host machine directory to serve as TeamCity agent config directory. We recommend to provide this binding in order to persist agent configuration, e.g. authorization on the server. Please note that you should map a different folder for every new agent you create.

You can also provide your agent's name using -e AGENT_NAME="<agent name>". If this variable is omitted the name for the agent will be generated automatically by the server.

When you run the agent for the first time you should authorize it via TeamCity server UI - go to the Unauthorized Agents page in your browser. See more details.

All information about agent authorization is stored in agent's configuration folder. If you stop the container with the agent and then start a new one with the same config folder - the agent's name and authorization state will be preserved.

TeamCity agent does not need manual upgrade: it will upgrade itself automatically on connection to an upgraded server.

Windows Containers Limitations

Details about known problems in Windows containers are available on the Known Issues page.

Customization

You can customize the image usual Docker procedure:

Run the image

docker run -it -e SERVER_URL="<url to TeamCity server>"  \ 
    -v <path to agent config folder>:/data/teamcity_agent/conf  \
    --name="my-customized-agent"  \
    jetbrains/teamcity-minimal-agent  \

enter into the container

docker exec -it my-customized-agent bash

and change whatever you need. Then exit and create new image from the container

docker commit my-customized-agent <the registry where you what to store the image>

License

The image is available under the TeamCity license.
TeamCity is free for perpetual use with the limitation of 20 build configurations (jobs) and 3 agents. Licensing details.

Feedback

Report issues of suggestions into official TeamCity issue tracker.

Under The Hood

This image is built on top of TeamCity base image which includes:

  • ubuntu:xenial (Linux)
  • microsoft/windowsservercore or microsoft/nanoserver (Windows)
  • Oracle JRE 8 Update 131, 64 bit
  • curl, unzip (Linux)

Limitation

The image is based on JRE 8 Update 131 with limited Java tool set available due to Oracle license policy. If you would need Java diagnostics tools, install JDK 8 Update 131, 64 bit into the container over the existing Java installation.

Other TeamCity Images

Dockerfile source

https://github.com/JetBrains/teamcity-docker-minimal-agent

Docker Pull Command
Owner
jetbrains

Comments (2)
staffaneinarsson
a year ago

On closer inspection it seems to be because the kernel version in the container is 4.4.15-moby, instead of 4.4.0-*-generic.

staffaneinarsson
a year ago

Hi. Would it be possible to change this so that it builds on Ubuntu Xenial 16.04 instead? I'm trying to launch build containers from this container (by sharing the docker.sock) but having trouble since Wily 15.10 seems to have flaky support for the aufs driver, which works fine in Xenial 16.04.