Is it possible to use TeamCity to build Windows docker container images?

As subj says. Is it possible to do? Visual Studio Online provides option to use remote build agent to create Windows Container Images based on dockerfile, wondering is TeamCity has this capability.

Jenkins also has it. https://plugins.jenkins.io/docker-commons

Spent quite sometime going through documentation and can not find anything about TeamCity support for building docker images. Starting to think TeamCity does not have this capability and our company made wrong decision to use TeamCity.

2
9 comments

Hello,

Do I correctly understand that you want to run builds in docker container? At the moment there is no official TeamCity plugin. You can use Command line build step to run docker image on agent. Also you can try a third-party plugin: https://github.com/jonnyzzz/TeamCity.Virtual.

0
Avatar
Permanently deleted user

No I want to create docker container image based on artifacts (like dockerfile etc)

Here is how similar plugin looks like in Visual Studio Online. You can specify where your dockerfile is and how to build your container image and where to upload it.

 

0
Avatar
Permanently deleted user

An answer?

0
Avatar
Permanently deleted user

I think you can install docker and use it from cmd or powershell steps.

If you can build image remotely (not at build agent itself) you only need docker utility not a docker daemon/service.

0
Avatar
Permanently deleted user

Yes, you can but this will require for you to provide all the plumbing necessary to make all of it work. As you can see from screenshot above VSO provides it out of the box with no additional coding necessary.

0
Avatar
Permanently deleted user

You are right. But docker build and push commands are so simple...

0
Avatar
Permanently deleted user

Once you start dealing with authenticated repositories, versioning, custom docker files etc it becomes more complicated to be handling purely in script.

0
Avatar
Permanently deleted user

While TeamCity debates wether it's needed feature or not VSTS just released latest update to their offerings with details targeting specifically to container deployment (https://azure.microsoft.com/en-us/blog/visual-studio-team-services-may-2017-digest/)

 

 

Built-in tasks for building and deploying container based applications

With this release we have pulled most of the tasks in our Docker extension into the product by default, improved them, and introduced a set of new tasks and templates for making a set of container scenarios easier.

  • Docker: Build, push, or run Docker images, or run a Docker command. This task can be used with Docker or Azure Container registry. You can now use our built-in service principal authentication with ACR to make it even easier to use.
  • Docker-Compose: Build, push, or run multi-container Docker applications. This task can be used with Docker or Azure Container registry.
  • Kubernetes: Deploy, configure, or update your Kubernetes cluster in Azure Container Service by running kubectl commands.
  • Service Fabric: Deploy containers to a Service Fabric Cluster. Service Fabric is the best choice today for running Windows Containers in the cloud. In fact, this is where more and more of VSTS itself is running each sprint.
0

TeamCity 2017.2+ has bundled Docker integration which allows to build docker images for windows and linux containers.

0

Please sign in to leave a comment.