图像已成功构建,但未在“泊坞窗图像”结果中显示

问题描述 投票:1回答:2

我正在尝试构建一个新的docker镜像。

docker build . -t tg
.....
.....
Removing intermediate container ba85d1deadeb
 ---> 353fcb84af6b
Successfully built 353fcb84af6b
Successfully tagged tg:latest

但由于某种原因,在它成功构建之后,我既无法运行也无法找到它。

docker images
<none>                               <none>              c18e928477c3        11 days ago         1.01GB
...... a long list of unrelated images that are intermediate steps of the built process .....

docker image lsdocker images -a也没有帮助。

sudo docker run -i -t 353fcb84af6b
Unable to find image '353fcb84af6b:latest' locally
docker: Error response from daemon: pull access denied for 353fcb84af6b, repository does not exist or may require 'docker login'.
See 'docker run --help'.

当运行docker run -i -t tg:latest结果是一样的。

这个问题似乎特定于这个特定的图像......其他成功构建的图像在运行docker images后显示出来。

Dockerfile

任何指针都非常感谢。

docker docker-image
2个回答
0
投票

您创建的图像名为tg,由-t标志提供。尝试使用该名称运行图像,它应该工作。


0
投票

1-要运行docker命令,请使用sudo user。

为什么 - > docker守护程序绑定到Unix套接字而不是TCP端口。默认情况下,Unix套接字由用户root拥有,而其他用户只能使用sudo访问它。

使用sudo docker build -t tag_name --no-cache构建映像。要查看图像 - sudo docker图像

此外,您不能使用带有图像ID的标签 - 无法在本地找到图像'353fcb84af6b:latest'

要运行映像,可以使用JUST映像ID或image_name:tag。

© www.soinside.com 2019 - 2024. All rights reserved.