Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

docker buildx fails to show result in image list

The following commands do not show the output ubuntu1 image:

docker buildx build -f 1.dockerfile -t ubuntu1 .
docker image ls | grep ubuntu1
# no output

1.dockerfile:

FROM ubuntu:latest
RUN echo "my ubuntu"

Plus, I cannot use the image in FROM statements in other docker files (both builds are on my local Windows box):

2.dockerfile:

FROM ubuntu1
RUN echo "my ubuntu 2"
docker buildx build -f 2.dockerfile -t ubuntu2 .

#error:
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 1.8s (4/4) FINISHED
 => [internal] load build definition from 2.dockerfile                                                                                                                                                        0.0s
 => => transferring dockerfile: 84B                                                                                                                                                                           0.0s
 => [internal] load .dockerignore                                                                                                                                                                             0.0s
 => => transferring context: 2B                                                                                                                                                                               0.0s
 => ERROR [internal] load metadata for docker.io/library/ubuntu1:latest                                                                                                                                       1.8s
 => [auth] library/ubuntu1:pull token for registry-1.docker.io                                                                                                                                                0.0s
------
 > [internal] load metadata for docker.io/library/ubuntu1:latest:
------
2.dockerfile:1
--------------------
   1 | >>> FROM ubuntu1:latest
   2 |     RUN echo "my ubuntu 2"
   3 |
--------------------
error: failed to solve: ubuntu1:latest: pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed (did you mean ubuntu:latest?)

Any idea what's going on? How can I see what buildx prepared and reference one image in another dockerfile?

like image 765
Sagi Mann Avatar asked Sep 05 '25 03:09

Sagi Mann


1 Answers

Ok found a partial solution, I need to add --output type=docker as per the docs. This puts the docker in the image list. But I still cannot use it in the second docker.

like image 137
Sagi Mann Avatar answered Sep 07 '25 20:09

Sagi Mann