This is an official JetBrains TeamCity server image.
The image is suitable for production use and evaluation purposes.
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
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
<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.
You will need at least one TeamCity agent to run builds. Check
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.
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:
- Oracle JRE 8 Update 121, 64 bit
- curl, unzip
The image is based on JRE 8 Update 77 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 77, 64 bit into the container over the existing Java installation.
Other TeamCity Images
Thank you, it's great to hear you love TeamCity. Regarding you questions
1) At the moment we don't have any plans about alpine, but we are going to open our base java image, so it would be easier for users to create their own images with TeamCity inside
2) We don't have any list on this matter as all those options come from TeamCity itself and therefor can be found in our online documentation
3) We don't have git installed in the server image but as I mentioned above we believe it would be easier to customize images soon
It depends on how you configure your MySQL db. One of the canonical case you can have separate container with MySQL and then link it to your TeamCity container.
Hi, I'm really in love with Teamcity
That being said had a few questions
- Is there any plan to release an alpine version of the server and agent?
- Is there a complete reference list of options that you can pass using -e
- The server doesn't seem to have git installed? Or is it just not added to the path?
Hi, how do you pass the configuration for an external MYSQL instance via env variables? I guess I'll need to pass values for the host, user and password?
It depends on how you configure your postgress db. One of the canonical case you can have separate container with postgress and then link it to your TeamCity container. So you will pass normal -e POSTGRES_PASSWORD=secret -e POSTGRES_USER=name in the first one.
how to pass postgresql password via environment variables ?
We recommend to do it using another container as a reverse proxy. TeamCity setup details for this case you can find here: https://confluence.jetbrains.com/display/TCD10/How%20To...#HowTo...-SetUpTeamCitybehindaProxyServer
Are there instructions for how to configure HTTPS? Or has anyone successfully done so who is willing to share instructions?
What I got when I run this server:
INFO: No Spring WebApplicationInitializer types detected on classpath
We are sorry for delay with answer. We missed the comment somehow. Looks like you forgot to map the port, should be - docker run -it -p 8111:8111 jetbrains/teamcity-server. More details about 'run' command options you can find above in image description section.