我从alpine docker本地创建的映像作为基础映像,当用于创建容器时抛出错误。
我还注意到docker总是在远程存储库中搜索这些映像。
❯ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
k8s-client 1.20.9 c099cb4a2ff0 2 minutes ago 470MB
swiftalk/k8s-client 1.20.9 798865e11408 5 minutes ago 470MB
swiftalk/terraform latest eaf18d663a17 3 days ago 88.1MB
swiftalk/packer latest 6bb62824b5b6 4 days ago 776MB
ubuntu bionic 7c0c6ae0b575 8 days ago 56.6MB
alpine/k8s 1.20.4 96faf4d3e224 9 days ago 533MB
❯ docker rmi swiftalk/k8s-client
Error: No such image: swiftalk/k8s-client
❯ docker run --rm -it --platform=linux/amd64 swiftalk/k8s-client:1.20.9 helm env
Unable to find image 'swiftalk/k8s-client:1.20.9' locally
docker: Error response from daemon: pull access denied for swiftalk/k8s-client, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.
See 'docker run --help'.
对于没有存储库前缀的图像也会出现相同的错误
❯ docker run --rm -it --platform=linux/amd64 k8s-client:1.20.9 helm env
Unable to find image 'k8s-client:1.20.9' locally
docker: Error response from daemon: pull access denied for k8s-client, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.
See 'docker run --help'.
我已经在本地构建了这些映像,并且没有将它们发布到任何私有的docker仓库
docker build --no-cache --build-arg KUBECTL_VERSION=1.20.9 &&
--build-arg HELM_VERSION=3.6.3 &&
--build-arg KUSTOMIZE_VERSION=v4.2.0 &&
--build-arg KUBESEAL_VERSION=V1.16.1 &&
--build-arg AWSCLI2_VERSION=2.2.25 -t swiftalk/k8s-client:1.20.9 .
I then try
docker build --no-cache --build-arg KUBECTL_VERSION=1.20.9 &&
--build-arg HELM_VERSION=3.6.3 &&
--build-arg KUSTOMIZE_VERSION=v4.2.0 &&
--build-arg KUBESEAL_VERSION=V1.16.1 &&
--build-arg AWSCLI2_VERSION=2.2.25 -t k8s-client:1.20.9 .
我想你正在尝试从私有存储库中提取图像
您将在这里找到如何提取私有图像和stackoverflow的答案在这里