threehundredfortyfive
threehundredfortyfive

Reputation: 89

How do I docker buildx build into a local "registry" container

I am trying to build a multi-arch image but would like to avoid pushing it to docker hub. I've had a lot of trouble finding out how to control the export options. is there a way to make "--push" push to a registry of my choosing?

Any help is appreciated

Upvotes: 8

Views: 15245

Answers (2)

weagle08
weagle08

Reputation: 1964

With buildkit to load image to local image store add the --load arg to your build command.

docker buildx build --load -t <image> --builder=container .

https://docs.docker.com/build/drivers/#loading-to-local-image-store

Upvotes: -3

BMitch
BMitch

Reputation: 263637

Images are specified using a "reference" which gets parsed to identify where the image is pushed or pulled from. That reference includes the registry, repository, and tag. If the registry is excluded, Docker Hub is used as the default. And if the tag is excluded, latest is used as a default. The syntax looks like:

registry.example.org/some/repository:tag

So to push your image to your own registry, you need to specify that registry in the image name that you build:

docker buildx build -t registry.example.org/some/repository:tag --push .

Additional configuration options for a registry can be defined in the buildkitd.toml. Buildx also allows for other output types, however, pushing to a docker engine before the transition to containerd for image management will only support a single platform.

Upvotes: -3

Related Questions