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

2

7

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

Facsimile answered 19/11, 2021 at 23:22 Comment(1)
I think you're looking for docker buildx build --load to load into local registry: docs.docker.com/engine/reference/commandline/buildx_build/#loadEnlistee
W
-2

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.

Wheelman answered 29/10, 2023 at 12:57 Comment(0)
F
-2

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

Foucquet answered 8/7 at 13:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.