Use same Docker container for whole build?
As I see it currently TeamCity creates a new container for each build step. Is there some way to create container on first step and use it during the all the steps? My case is that build step might sometimes have to e.g. install additional package and currently I need to do that in the all the steps as containers are always recreated.
Please sign in to leave a comment.
Hi Buumi,
I'm going to pass this question along to our devs, I'm not sure it's possible, and if not, maybe suggest it as a feature request, but in the meantime, is there any particular reason for your docker image not to have the required packages preinstalled?
Hello.
Is there are update on this?
I'd like to do `az login` in first build step and have several az commands in subsequent build steps which will utilize the same `az login` session
Hello,
I am afraid the only way to do so at the moment is to have the build itself run in the container - if you have a Kubernetes cluster, you may set up a cloud profile so that TeamCity would start a container for your builds with agent process running inside and invoke each step there. Alternatively, you may use Docker Compose step to start any number of containers and have them running until the build is over - but you would have to send commands to the container just like you would from the host machine.