Closed shawnho1018 closed 6 years ago
when doing kubectl create secret generic jenkins-docker-cfg --from-file=./config-pks.json
you must use ta file called config.json
as this CLI results in the key of the Secret being the name of the file.
e.g.
kubectl create secret generic jenkins-docker-cfg --from-file=./config.json
as per these docs: https://jenkins-x.io/architecture/docker-registry/#update-the-config-json-secret
you can also now use the CLI command jx create docker auth
https://jenkins-x.io/commands/jx_create_docker/
I added a bit more clarity to the docs here: https://jenkins-x.io/architecture/docker-registry/#update-the-config-json-secret and a warning about not using config.json
as the file name
When I build pipeline with jenkins x on AWS EKS, the following error shows:
build artifact: docker build: error during connect: creating docker context: getting relative tar paths: file pattern [repositories] must match at least one file" script returned exit code 1 How could I solve this error?
Summary
I am beginning to use jenkins-x. After playing with jx create quickstart -l python, I found my created pipeline could not successfully be built. It failed on skaffold build step with the following error:
2018/09/09 23:08:34 Unable to read "/home/jenkins/.docker/config.json", falling back on anonymous: open /home/jenkins/.docker/config.json: no such file or directory time="2018-09-09T23:08:35Z" level=fatal msg="build step: building [changeme]: build artifact: running build: docker build: Error response from daemon: Error processing tar file(exit status 1): unexpected EOF"
I checked my jenkins system settings (http://jenkins.jx.54.246.167.203.nip.io/configure) and found the secret-volume of jenkins-docker-config. I also checked my kubectl get secrets jenkins-docker-config and confirms its existence.Steps to reproduce the behavior
kubectl create secret generic jenkins-docker-cfg --from-file=./config-pks.json
with the following files{ "auths": { "harbor-fqdn.vke-user.com": { "auth": "YWRtaW46Zm94YmVyeWw=" } }, "HttpHeaders": { "User-Agent": "Docker-Client/18.01.0-ce (linux)" } }
2018/09/09 23:08:34 Unable to read "/home/jenkins/.docker/config.json", falling back on anonymous: open /home/jenkins/.docker/config.json: no such file or directory time="2018-09-09T23:08:35Z" level=fatal msg="build step: building [changeme]: build artifact: running build: docker build: Error response from daemon: Error processing tar file(exit status 1): unexpected EOF"
script returned exit code 1
Kubernetes cluster
What kind of Kubernetes cluster are you using & how did you create it? VKE K8S cluster opened in privileged mode. vke create cluster
Operating system / Environment
Expected behavior
The pipeline can be executed correctly.
Actual behavior
The pipeline failed in the skaffold step.