We'd like to be able to use docker buildx build to create two multiplatform images, one dependent on the first without pushing to a "remote" (=not on the same physical computer) registry.
Imagine
Proposed Solution
a checkbox in the rancher-desktop ui which triggers some magic:
☑️ Run local docker registry (enables building multiplatform images w/ docker buildx build w/o publishing images to remote systems)
backend code which will start a docker registry container
the precise container is up to the implementer, it could be something like:
docker run -d -p 5001:5000 --restart=always --name registry registry:2
(don't use port 5000, on macOS that's used by AirTunes)
If the rancher-desktop implementation wants to properly set up certificates for the registry, it's welcome to do that -- I'm not sure who is responsible for doing the certificate validation (is it the docker run by the user, or the mobyd that rancher runs)?
If the rancher-desktop implementation wants to set up the registry w/o https, then it should probably add DOCKER_OPTS="--insecure-registry=insecure.home:80" (where this corresponds to the container that hosts the registry) to /etc/conf.d/docker in the vm that hosts mobyd.
the ui should show the user the hostname/port for the container so they know how to use it 😄.
(cd foo; docker buildx build --platform linux/arm64,linux/amd64 -t foo .); (cd bar; docker buildx build --platform linux/arm64,linux/amd64 -t bar .);
2022/06/29 18:00:54 http2: server connection error from localhost: connection error: PROTOCOL_ERROR
[+] Building 0.2s (8/8) FINISHED
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 76B 0.0s
=> [linux/amd64 internal] load metadata for docker.io/library/busybox:latest 0.2s
=> [linux/arm64 internal] load metadata for docker.io/library/busybox:latest 0.2s
=> [linux/arm64 1/2] FROM docker.io/library/busybox@sha256:3614ca5eacf0a3a1bcc361c939202a974b4902b9334ff36eb29ffe9011aaad83 0.0s
=> => resolve docker.io/library/busybox@sha256:3614ca5eacf0a3a1bcc361c939202a974b4902b9334ff36eb29ffe9011aaad83 0.0s
=> [linux/amd64 1/2] FROM docker.io/library/busybox@sha256:3614ca5eacf0a3a1bcc361c939202a974b4902b9334ff36eb29ffe9011aaad83 0.0s
=> => resolve docker.io/library/busybox@sha256:3614ca5eacf0a3a1bcc361c939202a974b4902b9334ff36eb29ffe9011aaad83 0.0s
=> CACHED [linux/arm64 2/2] RUN echo 'hello' > world 0.0s
=> CACHED [linux/amd64 2/2] RUN echo 'hello' > world 0.0s
WARNING: No output specified for docker-container driver. Build result will only remain in the build cache. To push result image into registry use --push or to load image into docker use --load
WARNING: No output specified for docker-container driver. Build result will only remain in the build cache. To push result image into registry use --push or to load image into docker use --load
[+] Building 0.3s (4/4) FINISHED
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 73B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> CANCELED [linux/amd64 internal] load metadata for docker.io/library/foo:latest 0.3s
=> ERROR [linux/arm64 internal] load metadata for docker.io/library/foo:latest 0.3s
------
> [linux/arm64 internal] load metadata for docker.io/library/foo:latest:
------
Dockerfile:1
--------------------
1 | >>> from foo
2 |
3 | RUN echo 'cruel' >> world
--------------------
error: failed to solve: foo: pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed
Note that buildx generally runs in its own docker container which means that localhost will actually not be the host machine and won't be the mobyd host (lima/wsl). Which may mean that it isn't possible to use insecure registry.
Problem Description
We'd like to be able to use
docker buildx build
to create two multiplatform images, one dependent on the first without pushing to a "remote" (=not on the same physical computer) registry.Imagine
Proposed Solution
docker buildx build
w/o publishing images to remote systems)docker registry container
(don't use port
5000
, on macOS that's used by AirTunes)docker
run by the user, or themobyd
that rancher runs)?DOCKER_OPTS="--insecure-registry=insecure.home:80"
(where this corresponds to the container that hosts the registry) to/etc/conf.d/docker
in the vm that hostsmobyd
.Additional Information
foo/Dockerfile
:bar/Dockerfile
:Note that
buildx
generally runs in its own docker container which means thatlocalhost
will actually not be the host machine and won't be the mobyd host (lima/wsl). Which may mean that it isn't possible to useinsecure registry
.