0

the images I created locally from alpine docker as base image throw error when used to create a container.

I've also noticed docker always goes to search in remote repositories for these images.

❯ 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'. 

same error for images wihtout a repository prefix

❯ 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'.

I've build these images locally and not published them to any private docker repo

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 tried

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 .
Anadi Misra
  • 1,925
  • 4
  • 39
  • 68
  • If possible the `docker` command on your pc is something which you made as a wrapper script to call real docker command? What's the result of `file $(which docker)`? – atline Aug 04 '21 at 06:00
  • Installed docker for Mac M1 from the installer on their website, here's the output `/usr/local/bin/docker: Mach-O 64-bit executable arm64` – Anadi Misra Aug 04 '21 at 09:11
  • What's your docker version? And how about if you use `docker run --pull never --rm -it ...`? – atline Aug 04 '21 at 09:17
  • Docker version is `20.10.7` interestingly when I build images without repository name it works ie removed all `swiftalk` prefixes and then rebuilt images without a repo name and it works now – Anadi Misra Aug 04 '21 at 12:47

1 Answers1

0

i think you are trying to pull image from a private repository

you will found here how to pull private images and stackoverflow answer here

heheh
  • 194
  • 6
  • no I'm not, the images are only on my machine only. built like so `docker image build -t swiftalk/k8s-client:1.20.9 .` – Anadi Misra Aug 04 '21 at 05:38