TeamCity comes with Docker Support, implemented as a bundled plugin.
TeamCity-Docker support can run on Mac, Linux, and Windows build agents. It uses the
During the build, the build agent reports the following parameters:
|The Docker CLI version|
|The Docker Compose file version if the Docker Compose build step is used|
|The Docker Engine version|
|The Docker Engine OS platform, can have the |
If you are using the Command Line Build step (and not the TeamCity-provided docker steps), these parameters can be used as agent requirements to ensure your build is run only on the agents with Docker installed.
TeamСity-Docker integration provides the following features which facilitate working with Docker under TeamCity:
TeamCity provides the Docker Wrapper extension for Command Line, Maven, Ant, and Gradle runners. Each of the supported runners has the dedicated Docker settings section.
When there is not enough disk space on the agent at the beginning of the build, the
docker system prune -a command will be run cleaning the local Docker Caches. The command is run only as the last resort if all other cleaners did not manage to free enough space. Docker Disk Space Cleaner is an extension to the Free Disk Space build feature ensuring a certain amount of disk space for a build.
Since 2018.1.2 the plugin won't use the
-a key to clean all data, and will use the
--volumes key if it is allowed by the current docker version.
If TeamCity (for some reason) cannot determine that an image was pushed, a user can send a special Service Message to report this information to the TeamCity server:
##teamcity[dockerMessage type='dockerImage.push' value='<full_image_tag>,size:<size in bytes>,digest:<hash>']
##teamcity[dockerMessage type='dockerImage.push' value='myRegistry/repo-test:17,size:2632,digest:sha256:8dc5a195c3dcdc7c288d16288ff3f9ab1d8a5a230e09afb9c8dc9215e861aa55']