简体   繁体   中英

TeamCity: push docker image to AWS ECR

Running TeamCity 2019.1.4 with one server and three separate agents. Both agents and the server are running in their respective server/agent containers in separate EC2 instances. I want the build artifact (docker image) to be pushed to the ECR. Permission is configured via IAM role. I am getting Unauthorized error when pushing/pulling. Manually pulling image from the agent EC2 host works. But manually pulling from within the agent EC2 container gives the same error. How do I configure the TeamCity agent container to identify itself as the host machine?

PS: An option I am trying to avoid is to run TeamCity agents in a classic mode (manual installation) which will most likely work.

Do the following:

  • in TeamCity project configuration, add ECR connection.
  • then, in the build configuration, add build feature, add "Docker Support".
  • make sure the choice "Log in to the Docker registry before the build" is checked and you choose the ECR connection from the project configuration.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM