5

I was reading the docs regarding docker buildx build to build to multiple architectures and I got puzzled with the --push option, it says that it pushes to the registry directly but how does it know or how can I specify where I want it to push the built images?

For more context, my plan is to push the images to my Gitlab private container registry from my Gitlab CI/CD pipeline

2
  • 1
    just specify your registry in the tag myregistry.com/myImage:latest (and dont forget to docker login myregistry.com)
    – IamK
    Commented Oct 3, 2022 at 9:43
  • Aaaah sorry I didn't know you could specify also the registry inside the tag, I will try that as soon as I get back to my PC if you want to answer that I'll gladly accept it as an answer :D
    – RabidTunes
    Commented Oct 3, 2022 at 10:01

1 Answer 1

7

First login to your private registry, with the command docker login myregistry.com. After that specify your registry in the tag name of your image docker buildx build --push -t myregistry.com/appname:version . and it should push your image to myregistry.com after build.

Note: Docker looks for either a “.” (domain separator) or “:” (port separator) to learn that the first part of the repository name is a location and not a user name.

Not the answer you're looking for? Browse other questions tagged or ask your own question.