rancher-sandbox / rancher-desktop

Container Management and Kubernetes on the Desktop
https://rancherdesktop.io
Apache License 2.0
6.02k stars 285 forks source link

Support hosting a "local" docker registry #2475

Open jsoref opened 2 years ago

jsoref commented 2 years ago

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

Additional Information


foo/Dockerfile:

from busybox

RUN echo 'hello' > world

bar/Dockerfile:

from foo

RUN echo 'cruel' >> world
(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.

DrackThor commented 1 year ago

Hi guys, any progress on this issue? I'm facing exactly the same thing here.