quick-keyboard-83126
06/29/2022, 8:49 PMdocker buildx build
to chain build dependencies, but apparently in order to do that, i need to use --push
, but I don't really want to publish to a remote registry, so I tried using:
docker run -d -p 5001:5000 --restart=always --name registry registry:2
(port 5000 is in use by Server: AirTunes/615.12.1
)
But (once I pick my non localhost ip address...), this fails miserably with:
error: failed to solve: failed to do request: Head "https://<my-non-localhost-ip>:5001/v2/foo/blobs/sha256:<random-sha>": http: server gave HTTP response to HTTPS client
I understand that registry
speaks http
out of the box and docker
wants to speak https
. I get that there's a file I could change (but, I suspect that I'd have to change it in my. lima vm
, and that doing this would be arguably very dangerous).
Anyone have suggestions?fast-garage-66093
06/29/2022, 9:07 PMquick-keyboard-83126
06/29/2022, 9:07 PMfast-garage-66093
06/29/2022, 9:08 PMquick-keyboard-83126
06/29/2022, 9:08 PMfast-garage-66093
06/29/2022, 9:09 PMlima-rancher-desktop:~# tail -1 /etc/conf.d/docker
DOCKER_OPTS="--insecure-registry=insecure.home:80"
quick-keyboard-83126
06/29/2022, 9:11 PMfast-garage-66093
06/29/2022, 9:11 PMquick-keyboard-83126
06/29/2022, 9:12 PMfast-garage-66093
06/29/2022, 9:12 PMquick-keyboard-83126
06/29/2022, 9:12 PMfast-garage-66093
06/29/2022, 9:13 PMquick-keyboard-83126
06/29/2022, 9:13 PM(cd foo; cat Dockerfile; docker buildx build --platform linux/arm64,linux/amd64 -t foo .); (cd bar; cat Dockerfile; docker buildx build --platform linux/arm64,linux/amd64 -t bar .)
from busybox
RUN echo 'hello' > world
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.2s (8/8) FINISHED
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 76B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [linux/amd64 internal] load metadata for <http://docker.io/library/busybox:latest|docker.io/library/busybox:latest> 0.2s
=> [linux/arm64 internal] load metadata for <http://docker.io/library/busybox:latest|docker.io/library/busybox:latest> 0.2s
=> [linux/arm64 1/2] FROM <http://docker.io/library/busybox@sha256:3614ca5eacf0a3a1bcc361c939202a974b4902b9334ff36eb29ffe9011aaad83|docker.io/library/busybox@sha256:3614ca5eacf0a3a1bcc361c939202a974b4902b9334ff36eb29ffe9011aaad83> 0.0s
=> => resolve <http://docker.io/library/busybox@sha256:3614ca5eacf0a3a1bcc361c939202a974b4902b9334ff36eb29ffe9011aaad83|docker.io/library/busybox@sha256:3614ca5eacf0a3a1bcc361c939202a974b4902b9334ff36eb29ffe9011aaad83> 0.0s
=> [linux/amd64 1/2] FROM <http://docker.io/library/busybox@sha256:3614ca5eacf0a3a1bcc361c939202a974b4902b9334ff36eb29ffe9011aaad83|docker.io/library/busybox@sha256:3614ca5eacf0a3a1bcc361c939202a974b4902b9334ff36eb29ffe9011aaad83> 0.0s
=> => resolve <http://docker.io/library/busybox@sha256:3614ca5eacf0a3a1bcc361c939202a974b4902b9334ff36eb29ffe9011aaad83|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
from foo
RUN echo 'cruel' >> world
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/arm64 internal] load metadata for <http://docker.io/library/foo:latest|docker.io/library/foo:latest> 0.3s
=> ERROR [linux/amd64 internal] load metadata for <http://docker.io/library/foo:latest|docker.io/library/foo:latest> 0.3s
------
> [linux/amd64 internal] load metadata for <http://docker.io/library/foo:latest|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
cat foo/Dockerfile; echo '----'; cat bar/Dockerfile
from busybox
RUN echo 'hello' > world
----
from foo
RUN echo 'cruel' >> world
(cd foo; cat Dockerfile; docker build -t foo .); (cd bar; cat Dockerfile; docker build -t bar .)
from busybox
RUN echo 'hello' > world
Sending build context to Docker daemon 2.048kB
Step 1/2 : from busybox
---> 3c277069c6ae
Step 2/2 : RUN echo 'hello' > world
---> Using cache
---> 68edd097ffa9
Successfully built 68edd097ffa9
Successfully tagged foo:latest
from foo
RUN echo 'cruel' >> world
Sending build context to Docker daemon 2.048kB
Step 1/2 : from foo
---> 68edd097ffa9
Step 2/2 : RUN echo 'cruel' >> world
---> Running in c282b4b1c190
Removing intermediate container c282b4b1c190
---> 65f0f7d6e0b9
Successfully built 65f0f7d6e0b9
Successfully tagged bar:latest
-t foo
and -t bar
, but instead using -t real.registry/path/foo
and -t real.registry/path/bar
and updating my from foo
in bar/Dockerfile
to from real.registry/path/foo
.fast-garage-66093
06/29/2022, 9:22 PM$ docker buildx build --platform linux/arm64,linux/amd64 -t foo . --load
[+] Building 0.0s (0/0)
error: docker exporter does not currently support exporting manifest lists
quick-keyboard-83126
06/29/2022, 9:22 PMfast-garage-66093
06/29/2022, 9:25 PMquick-keyboard-83126
06/29/2022, 9:26 PMfast-garage-66093
06/29/2022, 9:26 PMlocalhost
?$ docker run -d -p 5001:5000 --restart=always --name registry registry:2
Unable to find image 'registry:2' locally
2: Pulling from library/registry
2408cc74d12b: Pull complete
ea60b727a1ce: Pull complete
c87369050336: Pull complete
e69d20d3dd20: Pull complete
fc30d7061437: Pull complete
Digest: sha256:bedef0f1d248508fe0a16d2cacea1d2e68e899b2220e2258f1b604e1f327d475
Status: Downloaded newer image for registry:2
cda0f8aad69d1a53870bb9f285e3c4a10765e96c233ba277f45f3111ed3de405
$ docker tag registry:2 localhost:5001/registry:2
$ docker push localhost:5001/registry:2
The push refers to repository [localhost:5001/registry]
a1d94f4a4c89: Pushed
1d80677cd085: Pushed
58548fced558: Pushed
79f02b258438: Pushed
24302eb7d908: Pushed
2: digest: sha256:affdb68e24c93262ee98a5bdc371e8f631568e9b4401375e7a0ecc705ac526b2 size: 1363
quick-keyboard-83126
06/29/2022, 9:30 PM(cd foo; cat Dockerfile; docker buildx build --platform linux/arm64,linux/amd64 -t 127.0.0.1:5001/foo .); (cd bar; cat Dockerfile; docker buildx build --platform linux/arm64,linux/amd64 -t bar .); curl -v 127.0.0.1:5001/foo:latest
from busybox
RUN echo 'hello' > world
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.1s (8/8) FINISHED
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 76B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [linux/amd64 internal] load metadata for <http://docker.io/library/busybox:latest|docker.io/library/busybox:latest> 0.1s
=> [linux/arm64 internal] load metadata for <http://docker.io/library/busybox:latest|docker.io/library/busybox:latest> 0.1s
=> [linux/amd64 1/2] FROM <http://docker.io/library/busybox@sha256:3614ca5eacf0a3a1bcc361c939202a974b4902b9334ff36eb29ffe9011aaad83|docker.io/library/busybox@sha256:3614ca5eacf0a3a1bcc361c939202a974b4902b9334ff36eb29ffe9011aaad83> 0.0s
=> => resolve <http://docker.io/library/busybox@sha256:3614ca5eacf0a3a1bcc361c939202a974b4902b9334ff36eb29ffe9011aaad83|docker.io/library/busybox@sha256:3614ca5eacf0a3a1bcc361c939202a974b4902b9334ff36eb29ffe9011aaad83> 0.0s
=> [linux/arm64 1/2] FROM <http://docker.io/library/busybox@sha256:3614ca5eacf0a3a1bcc361c939202a974b4902b9334ff36eb29ffe9011aaad83|docker.io/library/busybox@sha256:3614ca5eacf0a3a1bcc361c939202a974b4902b9334ff36eb29ffe9011aaad83> 0.0s
=> => resolve <http://docker.io/library/busybox@sha256:3614ca5eacf0a3a1bcc361c939202a974b4902b9334ff36eb29ffe9011aaad83|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
from 127.0.0.1:5001/foo
RUN echo 'cruel' >> world
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.0s (4/4) FINISHED
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 88B 0.0s
=> ERROR [linux/amd64 internal] load metadata for 127.0.0.1:5001/foo:latest 0.0s
=> CANCELED [linux/arm64 internal] load metadata for 127.0.0.1:5001/foo:latest 0.0s
------
> [linux/amd64 internal] load metadata for 127.0.0.1:5001/foo:latest:
------
Dockerfile:1
--------------------
1 | >>> from 127.0.0.1:5001/foo
2 |
3 | RUN echo 'cruel' >> world
--------------------
error: failed to solve: 127.0.0.1:5001/foo: failed to do request: Head "<http://127.0.0.1:5001/v2/foo/manifests/latest>": dial tcp 127.0.0.1:5001: connect: connection refused
* Trying 127.0.0.1:5001...
* Connected to 127.0.0.1 (127.0.0.1) port 5001 (#0)
> GET /foo:latest HTTP/1.1
> Host: 127.0.0.1:5001
> User-Agent: curl/7.79.1
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 404 Not Found
< Content-Type: text/plain; charset=utf-8
< Docker-Distribution-Api-Version: registry/2.0
< X-Content-Type-Options: nosniff
< Date: Wed, 29 Jun 2022 21:29:36 GMT
< Content-Length: 19
<
404 page not found
* Connection #0 to host 127.0.0.1 left intact
fast-garage-66093
06/29/2022, 9:31 PM--push
instead of --load
)quick-keyboard-83126
06/29/2022, 9:33 PM(cd foo; cat Dockerfile; docker buildx build --platform linux/arm64,linux/amd64 -t 127.0.0.1:5001/foo . --push); (cd bar; cat Dockerfile; docker buildx build --platform linux/arm64,linux/amd64 -t bar .); curl -v 127.0.0.1:5001/foo:latest
from busybox
RUN echo 'hello' > world
[+] Building 0.3s (9/9) FINISHED
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 76B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [linux/amd64 internal] load metadata for <http://docker.io/library/busybox:latest|docker.io/library/busybox:latest> 0.2s
=> [linux/arm64 internal] load metadata for <http://docker.io/library/busybox:latest|docker.io/library/busybox:latest> 0.2s
=> [linux/amd64 1/2] FROM <http://docker.io/library/busybox@sha256:3614ca5eacf0a3a1bcc361c939202a974b4902b9334ff36eb29ffe9011aaad83|docker.io/library/busybox@sha256:3614ca5eacf0a3a1bcc361c939202a974b4902b9334ff36eb29ffe9011aaad83> 0.0s
=> => resolve <http://docker.io/library/busybox@sha256:3614ca5eacf0a3a1bcc361c939202a974b4902b9334ff36eb29ffe9011aaad83|docker.io/library/busybox@sha256:3614ca5eacf0a3a1bcc361c939202a974b4902b9334ff36eb29ffe9011aaad83> 0.0s
=> [linux/arm64 1/2] FROM <http://docker.io/library/busybox@sha256:3614ca5eacf0a3a1bcc361c939202a974b4902b9334ff36eb29ffe9011aaad83|docker.io/library/busybox@sha256:3614ca5eacf0a3a1bcc361c939202a974b4902b9334ff36eb29ffe9011aaad83> 0.0s
=> => resolve <http://docker.io/library/busybox@sha256:3614ca5eacf0a3a1bcc361c939202a974b4902b9334ff36eb29ffe9011aaad83|docker.io/library/busybox@sha256:3614ca5eacf0a3a1bcc361c939202a974b4902b9334ff36eb29ffe9011aaad83> 0.0s
=> CACHED [linux/amd64 2/2] RUN echo 'hello' > world 0.0s
=> CACHED [linux/arm64 2/2] RUN echo 'hello' > world 0.0s
=> ERROR exporting to image 0.0s
=> => exporting layers 0.0s
=> => exporting manifest sha256:0d067956ce52bc021a48a4ccd287c3829f4b0eca79a5fa419a35f82d634e25e0 0.0s
=> => exporting config sha256:cec764602494d167dbf293bccaf36a0880332bf4037ed31ad81fed0505f6ecb3 0.0s
=> => exporting manifest sha256:8cc4b99868c5c81d709fe248d69f899ba04267d340f13424bcc10e8704857770 0.0s
=> => exporting config sha256:3efad4c0fdf3cf85b6ef37fea7eb9092a5ba9ad72e0bb2ff55eb9f33534527d9 0.0s
=> => exporting manifest list sha256:29131e9a7b5a8cbe1a5e93e8427332a2ade54eea915d97fbb3dfeb445102e866 0.0s
=> => pushing layers 0.0s
------
> exporting to image:
------
error: failed to solve: failed to do request: Head "<http://127.0.0.1:5001/v2/foo/blobs/sha256:cec764602494d167dbf293bccaf36a0880332bf4037ed31ad81fed0505f6ecb3>": dial tcp 127.0.0.1:5001: connect: connection refused
from 127.0.0.1:5001/foo
RUN echo 'cruel' >> world
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.0s (4/4) FINISHED
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 88B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> ERROR [linux/amd64 internal] load metadata for 127.0.0.1:5001/foo:latest 0.0s
=> CANCELED [linux/arm64 internal] load metadata for 127.0.0.1:5001/foo:latest 0.0s
------
> [linux/amd64 internal] load metadata for 127.0.0.1:5001/foo:latest:
------
Dockerfile:1
--------------------
1 | >>> from 127.0.0.1:5001/foo
2 |
3 | RUN echo 'cruel' >> world
--------------------
error: failed to solve: 127.0.0.1:5001/foo: failed to do request: Head "<http://127.0.0.1:5001/v2/foo/manifests/latest>": dial tcp 127.0.0.1:5001: connect: connection refused
* Trying 127.0.0.1:5001...
* Connected to 127.0.0.1 (127.0.0.1) port 5001 (#0)
> GET /foo:latest HTTP/1.1
> Host: 127.0.0.1:5001
> User-Agent: curl/7.79.1
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 404 Not Found
< Content-Type: text/plain; charset=utf-8
< Docker-Distribution-Api-Version: registry/2.0
< X-Content-Type-Options: nosniff
< Date: Wed, 29 Jun 2022 21:32:47 GMT
< Content-Length: 19
<
404 page not found
* Connection #0 to host 127.0.0.1 left intact
% docker run -d -p 5001:5000 --restart=always --name registry registry:2
da7c130ba1956c9c191c8d5957459b19d34cdc33900377381cbb7208222f4c63
fast-garage-66093
06/29/2022, 9:34 PMlocalhost
refers to the container and not the VM 😞quick-keyboard-83126
06/29/2022, 9:34 PMfast-garage-66093
06/29/2022, 9:38 PMquick-keyboard-83126
06/29/2022, 9:39 PMmoby
on linux/amd64
and talking to it when doing build... --platform linux/amd64
and running a moby
on linux/arm64
and talking to it when doing build... -platform linux/arm64
...)fast-garage-66093
06/29/2022, 9:42 PMquick-keyboard-83126
06/29/2022, 9:42 PMfast-garage-66093
06/29/2022, 9:42 PMquick-keyboard-83126
06/29/2022, 9:43 PMfast-garage-66093
06/29/2022, 9:43 PMquick-keyboard-83126
06/29/2022, 9:44 PMfast-garage-66093
06/29/2022, 9:45 PMquick-keyboard-83126
06/29/2022, 9:45 PMfast-garage-66093
06/29/2022, 9:46 PMquick-keyboard-83126
06/29/2022, 9:46 PMfast-garage-66093
06/29/2022, 9:47 PMquick-keyboard-83126
06/29/2022, 9:52 PMfast-garage-66093
06/29/2022, 9:54 PMk3d
quick-keyboard-83126
06/29/2022, 9:55 PMk3d
, but don't have the energy to reason out the modifications to this text.fast-garage-66093
06/29/2022, 9:55 PMquick-keyboard-83126
06/29/2022, 9:58 PMfast-garage-66093
06/29/2022, 9:59 PMquick-keyboard-83126
06/29/2022, 10:00 PMfast-garage-66093
06/29/2022, 10:01 PM/var/lib/docker/volumes/
inside the VM...quick-keyboard-83126
06/29/2022, 10:07 PMvolume mounts
fast-garage-66093
06/29/2022, 10:08 PMquick-keyboard-83126
06/29/2022, 10:08 PMfast-garage-66093
06/29/2022, 10:09 PMquick-keyboard-83126
06/29/2022, 10:10 PMimages
pane?fast-garage-66093
06/29/2022, 10:10 PMquick-keyboard-83126
06/29/2022, 10:10 PMfast-garage-66093
06/29/2022, 10:11 PMdocker prune
quick-keyboard-83126
06/29/2022, 10:12 PMfast-garage-66093
06/29/2022, 10:12 PMquick-keyboard-83126
06/29/2022, 10:13 PMfast-garage-66093
06/29/2022, 10:13 PMquick-keyboard-83126
06/29/2022, 10:13 PMfast-garage-66093
06/29/2022, 10:15 PMquick-keyboard-83126
06/29/2022, 10:16 PMfast-garage-66093
06/29/2022, 10:16 PMquick-keyboard-83126
06/29/2022, 10:16 PMimages
feature today?fast-garage-66093
06/29/2022, 10:16 PMquick-keyboard-83126
06/29/2022, 10:16 PMfast-garage-66093
06/29/2022, 10:17 PM$ docker system prune
WARNING! This will remove:
- all stopped containers
- all networks not used by at least one container
- all dangling images
- all dangling build cache
Are you sure you want to continue? [y/N] ^C
quick-keyboard-83126
06/29/2022, 10:19 PMprune dangling images
or a behavior that just automatically garbage collects whenever anyone removes a tag from the regsitry...fast-garage-66093
06/29/2022, 10:19 PMreg
to even list the images in a registryquick-keyboard-83126
06/29/2022, 10:19 PMfast-garage-66093
06/29/2022, 10:21 PMquick-keyboard-83126
06/29/2022, 10:21 PMnexus
which can host all of these fun blobsfast-garage-66093
06/29/2022, 10:23 PMquick-keyboard-83126
06/29/2022, 10:24 PMfast-garage-66093
06/29/2022, 10:24 PM192.168.5.15
; we just need to declare it as insecure...quick-keyboard-83126
06/29/2022, 10:27 PMfast-garage-66093
06/29/2022, 10:27 PMquick-keyboard-83126
06/30/2022, 12:02 AMcat > buildkit-config.toml <<EOF
# Custom registry.
[registry."192.168.0.2:5050"]
http = true
insecure = true
EOF
docker buildx create --use --config buildkit-config.toml
Not sure if that's compatible w/ the stuff I'm already doing, but.