

- #Teamcity docker install#
- #Teamcity docker code#
- #Teamcity docker download#
- #Teamcity docker windows#
TeamСity-Docker integration provides the following features which facilitate working with Docker under TeamCity: 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.
#Teamcity docker windows#
The Docker Engine OS platform, can have the linux or windows value If you use it, you get more concurrency and cache efficiency, cool new features and useful UI outputs.The Docker Compose file version if the Docker Compose build step is used It’s a new image build engine, which can be used instead of the default Docker one. Tip 5: Use BuildKit with the new cache mount feature.īuildKit is pretty cool.
#Teamcity docker download#
This way, you will only get the packages you asked for and their necessary requirements, reducing the download and installation time while building your Docker image.
#Teamcity docker install#
You can avoid this, by adding the -no-install-recommends flag like this: apt-get install -yqq -no-install-recommends $YOUR_PACKAGES Those are packages you don’t specify (or need) explicitly, but which are installed nevertheless because you might want to have them. For examle, apt which is used on Ubuntu and Debian, installs “recommended” packages by default. One more thing to keep in mind, is the default behaviour of your OS-level package manager. You can probably split them out as “development dependencies” in your package-manager of choice and exclude them from the image this way. If your Docker image builds takes a long time downloading dependencies, it’s a good idea to check whether you’re installing more than you need to.įirst, check if you might be downloading development dependencies which are not needed in your image at all. You can add everything else “on top” as in the second example. Only add the ones to the image which are needed in the next steps. If you COPYing files, try to do so selectively. Dependencies tend to change infrequently, so that’ll shave off a lot of unnecessary effort from the image build. Now, the third line would only run if the file in question changes.
#Teamcity docker code#
Here’s how we could avoid re-running the install step on every code change: RUN mkdir /code

That’s a pitty, because the third line only depends on one single file from the code directory: requirements.txt. Need to run again, and every following line as well. Imagine we have the following Dockerfile snippet: RUN mkdir /codeĮvery time anything within the code directory changes, the second line would Tip 3: Only copy files which are needed for the next step. Make sure large and slow-to-build layers come first in your Dockerfile. Layers where lots of slow work needs to happen, but which change infrequently early in your Dockerfile, and put quickly-changing and fast layers last. To make good use of the Docker cache, it’s a good idea to try and put

If you choose to use Docker for development, keep in mind that there are different styles of workflows.

