Score:1

Authorizing docker for TeamCity agent under Windows 10

ve flag

I have:

  • TeamCity CI
  • TeamCity agent, installed in Windows 10 as a Windows service
  • Some Java projects with integration tests, based on TestContainers framework.
  • Sonatype Nexus instance, configured as private docker registry

TestContainers based tests require docker to be available during project's build. All necessary images for the tests execution are located in Nexus. Which in turn means - in order to execute tests on CI, I should authenticate docker into Nexus in order to be able to pull them. And that's where the problem comes from.

I don't understand how should I authenticate docker for something, that is windows service (TeamCity agent).

Usually, it's done by docker login. I tried executing docker login from administrator's PowerShell on the agent's host, and it did succeeded - I am able now to pull images from administrator's console. But attempt to run the tests on the TeamCity agent fail, facing 401 Unauthorized on attempt to pull the images from Nexus. Like, the service is executed from somewhat user, for which docker login was not done.

How should I make docker authorized into private docker registry for Windows 10 TeamCity agent service?

Score:1
uz flag

You can set up docker authorization in Teamcity by going to Build Configuration -> Build Features -> Add Build Feature -> Docker Support -> Add Registry Connection

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.