profile
viewpoint

Ask questionsFailed to push image to Docker Hub

Actual behavior I am running Kubernetes v1.15.5 cluster and I created a Kaniko pod to build and push an image to Docker Hub, here is the pod.yaml:

apiVersion: v1
kind: Pod
metadata:
  name: kaniko
spec:
  containers:
  - name: kaniko
    image: gcr.io/kaniko-project/executor:latest
    args: ["--dockerfile=/workspace/Dockerfile",
           "--context=dir://workspace",
           "--destination=zhq527725/test-kaniko"]
    volumeMounts:
      - name: kaniko-secret
        mountPath: /root
      - name: dockerfile-storage
        mountPath: /workspace
  restartPolicy: Never
  volumes:
    - name: kaniko-secret
      secret:
        secretName: docker-hub
        items:
          - key: .dockerconfigjson
            path: .docker/config.json
    - name: dockerfile-storage
      persistentVolumeClaim:
        claimName: dockerfile-claim

And I created a secret for Kaniko to login Docker Hub:

kubectl create secret docker-registry docker-hub --docker-server=https://index.docker.io/v1/ --docker-username=zhq527725 --docker-password=<my-password> --docker-email=<my-email>

But I found Kaniko pod failed to push to Docker Hub, here is its logs:

error checking push permissions -- make sure you entered the correct tag name, and that you are authenticated correctly, and try again: checking push permission for "index.docker.io/zhq527725/test-kaniko:latest": UNAUTHORIZED: authentication required; [map[Action:pull Class: Name:zhq527725/test-kaniko Type:repository] map[Action:push Class: Name:zhq527725/test-kaniko Type:repository]]

And the I changed the --destination arg of Kaniko pod from zhq527725/test-kaniko to registry.docker.io/zhq527725/test-kaniko, but it still failed with a different error:

error checking push permissions -- make sure you entered the correct tag name, and that you are authenticated correctly, and try again: checking push permission for "registry.docker.io/zhq527725/test-kaniko:latest": creating push check transport for registry.docker.io failed: unrecognized HTTP status: 503 Service Unavailable

I confirm that I can use docker push with the same username/password to successfully push image into Docker Hub.

Expected behavior Successfully push images to Docker Hub.

So far, I have tested Kaniko in my Kubernetes cluster against Harbor, Docker Hub and gcr, and I found it only works with gcr.

GoogleContainerTools/kaniko

Answer questions gebi

we just had our kaniko setup stopped working with the same problem error checking push permissions as reported in #1209 .

Our fix was to just use mgit/base:kaniko-executor-debug-stable as image which also fixes #656

Is there anything we can help with regarding stabilizing kaniko?

useful!

Related questions

Possibility to pull-tag-push without build hot 2
Support for Azure Container Registry hot 2
HTTP 401 returned when trying to push to Dockerhub with correct credentials hot 2
Can't move files as part of a RUN? hot 1
Kaniko pod - Run as root or priviliged mode? hot 1
Kaniko Logs Leakage: Kaniko pod exiting before errors could be read by Skaffold or any other tool. hot 1
The container base on kaniko/executor image hangs when use knative to build image hot 1
Some log lines prefixed with "ERROR: logging before flag.Parse:" hot 1
Warmer does not work with private images hot 1
error building image: error building stage: lstat /tmp/apt-key-gpghome.VoPBz66R2g/gnupg_spawn_agent_sentinel.lock: no such file or directory hot 1
kaniko cant push to quay ent on prem hot 1
Multistage Dockerfile with copy and glob uses cached layer when it shouldn't hot 1
Build fail : Value too large for defined data type hot 1
Kaniko executor image fails to start (unknown command true for executor) hot 1
does kaniko support docker registry mirrors ? hot 1
Github User Rank List