skaffold: skaffold build w/ kaniko fails to push image to Docker Hub
Expected behavior
skaffold build w/ kaniko successfully pushes images to Docker Hub.
Actual behavior
skaffold build w/ kaniko fails to push image to Docker Hub.
skaffold build
Generating tags...
- okepy/skaffold-example -> okepy/skaffold-example:v1.0.0-119-g2543e76d-dirty
Checking cache...
- okepy/skaffold-example: Not found. Building
Creating docker config secret [docker-cfg]...
Building [okepy/skaffold-example]...
Storing build context at /var/folders/jn/6z4rmbv96wbgcpd7y4k1r7y00000gn/T/context-982e4adabe73af55eafdca0c5308aee2.tar.gz
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/okepy/skaffold-example:v1.0.0-119-g2543e76d-dirty": creating push check transport for index.docker.io failed: Get https://auth.docker.io/token?scope=repository%3Aokepy%2Fskaffold-example%3Apush%2Cpull&service=registry.docker.io: invoking docker-credential-desktop: exec: "docker-credential-desktop": executable file not found in $PATH; output:
FATA[0014] build failed: build failed: building [okepy/skaffold-example]: kaniko build for [okepy/skaffold-example]: waiting for pod to complete: condition error: pod already in terminal phase: Failed
Information
- Skaffold version: v1.0.1
- Operating system: macOS Catalina 10.15.1
- Contents of skaffold.yaml:
apiVersion: skaffold/v1
kind: Config
build:
artifacts:
- image: okepy/skaffold-example
kaniko:
buildContext:
localDir: {}
cache: {}
cluster:
namespace: default
dockerConfig:
# specify path or secretName
path: ~/.docker/config.json
# secretName: docker-cfg
deploy:
kubectl:
manifests:
- k8s-*
~/.docker/config.json
{
"stackOrchestrator" : "swarm",
"auths" : {
"https://index.docker.io/v1/" : {
"auth": "base64 decoded USER:PASSWORD"
},
},
"credHelpers" : {
"us.gcr.io" : "gcloud",
"asia.gcr.io" : "gcloud",
"staging-k8s.gcr.io" : "gcloud",
"marketplace.gcr.io" : "gcloud",
"gcr.io" : "gcloud",
"eu.gcr.io" : "gcloud"
},
"credsStore" : "desktop",
"experimental" : "disabled",
"HttpHeaders" : {
"User-Agent" : "Docker-Client/19.03.4 (darwin)"
}
}
Steps to reproduce the behavior
- https://github.com/GoogleContainerTools/skaffold/tree/master/examples/kaniko-local
- edit skaffold.yaml
skaffold build
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 2
- Comments: 18 (8 by maintainers)
I finally make it works:
I created the secret this way:
I hope it helps.
I ran into the same error and as the information here is a bit scattered around I will summarize the steps here.
echo "user123: pass123" | base64config.json
skaffold.yaml
I ran through the same issue, but:
It’s working with path:
The
config.jsonfile is in the same directory thanskaffold.yamlIt’s still not working with secretName, even if I followed what is documented in the code: