Public Repository

Last pushed: 7 days ago
Short Description
TeamCity Server - Powerful Continuous Integration and Continuous Delivery out of the box
Full Description

TeamCity Server - Powerful Continuous Integration and Continuous Delivery out of the box

This is an official JetBrains TeamCity server image.
The image is suitable for production use and evaluation purposes.

Image Tags

The Linux image tags have the following suffixes:

The Windows image tags have the following suffixes:

How to Use This Image

Pull the image from the Docker Hub Repository docker pull jetbrains/teamcity-server

Use the following command to start a container with TeamCity server inside

a Linux container:

docker run -it --name teamcity-server-instance  \
    -v <path to data directory>:/data/teamcity_server/datadir \
    -v <path to logs directory>:/opt/teamcity/logs  \
    -p <port on host>:8111 \
    jetbrains/teamcity-server

 
or a Windows container:

docker run -it --name teamcity-server-instance
    -v <path to data directory>:C:/ProgramData/JetBrains/TeamCity
    -v <path to logs directory>:C:/TeamCity/logs
    -p <port on host>:8111
    jetbrains/teamcity-server

 
where:

  • <path to data directory> is the host machine directory to serve as the TeamCity Data Directory where TeamCity stores project settings and build results. Pass an empty directory for the brand new start. If the mapping is not set, you will lose all the TeamCity settings on the container shutdown.
  • <path to logs directory> is the host machine directory to store the TeamCity server logs. The mapping can be omitted, but then the logs will be lost on container shutdown which will make issues investigation impossible.

TeamCity stores set of users and build results in an SQL database in addition to the Data Directory.

By default, the TeamCity server uses an internal database stored on the file system under the data directory. However, production use requires an external database.

To use the server for production, make sure to review and apply the recommendations.

You will need at least one TeamCity agent to run builds. Check the jetbrains/teamcity-agent and jetbrains/teamcity-minimal-agent images.

Windows Containers Limitations

The details on the known problems in Windows containers are available in the TeamCity documentation.

Additional Commands

When you need to pass additional environment variables to the server process, use the regular -e option. e.g. to pass TEAMCITY_SERVER_MEM_OPTS environment variable, use:

docker run -it --name teamcity-server-instance   \
       -e TEAMCITY_SERVER_MEM_OPTS="-Xmx2g -XX:ReservedCodeCacheSize=350m" \
       -v <path to data directory>:/data/teamcity_server/datadir  \
       -v <path to log directory>:/opt/teamcity/logs   \
       -p <port on host>:8111 \
       jetbrains/teamcity-server   

To run the maintainDB script (e.g. for the server backup), stop your running container and execute the following command from your host:

docker run -it --name teamcity-server-instance  \
    -v <path to data directory>:/data/teamcity_server/datadir  \
    -v <path to log directory>:/opt/teamcity/logs  \
    -p <port on host>:8111 \
    jetbrains/teamcity-server \
    "/opt/teamcity/bin/maintainDB.sh" "backup"

Be sure to keep all the local system paths the same with the main server start command.

To change the context of the TeamCity app inside TomCat container, pass -e TEAMCITY_CONTEXT=/context to docker run command. The default one is ROOT, meaning that the server would be available at http://host/

Upgrading TeamCity

Make sure to check the generic TeamCity upgrade instructions.
If you made no changes to the container, you can just stop the running container, pull a newer version of the image and the server in it via the usual command.
If you changed the image, you will need to replicate the changes to the new TeamCity server image. In general, use Docker common sense to perform the upgrade.

License

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

Feedback

Report issues of suggestions to the official TeamCity issue tracker.

Under the Hood

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

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

Limitations

The image is based on JRE 8 Update 161 with a limited Java tool set available as per the Oracle license policy. If you need Java diagnostics tools (e.g. to take a memory dump or take a thread dump for the TeamCity process), install JDK 8 Update 161, 64 bit into the container over the existing Java installation.

Other TeamCity Images

Dockerfile source

https://github.com/JetBrains/teamcity-docker-server

Docker Pull Command
Owner
jetbrains