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.
All default tags in docker images refers to the Linux images. Windows docker images have suffixes
Experimental image, feedback is welcome.
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 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 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:latest-nanoserver
<path to data directory> is the host machine directory to serve as TeamCity Data Directory where TeamCity stores project settings and build results. Pass empty directory for the brand new start. When the mapping is not set, you will lose all the TeamCity settings on container shutdown.
<path to logs directory> is the host machine directory to store 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 TeamCity server uses an internal database stored on the file system under the data directory. However, production use requires external database.
To use the server for production, make sure to review and apply the recommendations.
Windows Containers Limitations
Details about known problems in Windows containers are available on the Known Issues page.
When required to pass additional environment variables to the server process, use 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:MaxPermSize=270m -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
maintainDB script (e.g. for server backup) please 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 context of TeamCity app inside TomCat container, pass
-e TEAMCITY_CONTEXT=/context to
docker run command. Default one is
ROOT, means server would be available at
Make sure to check generic TeamCity upgrade instructions.
If you made no changes to the container, you can just stop the running container, pull 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 in order to perform the upgrade.
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)
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 (e.g. to take a memory dump or take a thread dump for the TeamCity process), install JDK 8 Update 131, 64 bit into the container over the existing Java installation.