以下命令不会显示输出
此外,我无法在其他Docker文件的
ubuntu1
镜像:docker buildx build -f 1.dockerfile -t ubuntu1 .
docker image ls | grep ubuntu1
# no output
1.dockerfile:
FROM ubuntu:latest
RUN echo "my ubuntu"
此外,我无法在其他Docker文件的
FROM
语句中使用该图像(两个构建都在我的本地Windows框上)。
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?)
有什么想法吗?我怎样能够看到buildx准备的内容并在另一个dockerfile中引用一个镜像?
docker buildx build -f 1.dockerfile -t ubuntu1 .
。 - life888888docker buildx build -f 1.dockerfile -t ubuntu1 .
是可以的,我在我的电脑上测试过了,没问题。我的环境是:Ubuntu 20.04,$ docker version 客户端: Docker Engine - Community 版本: 20.10.21 API 版本: 1.41 Go 版本: go1.18.7 Git 提交: baeda1f 构建时间: Tue Oct 25 18:02:21 2022 操作系统/架构: linux/amd64 上下文: 默认 实验性的: true - life888888--load
标志,加载构建的每个镜像,以便它们出现在docker images
命令返回的列表中。 - devatherock