Hide Forgot
Description of problem: Cannot recognize the default authentication file created by docker login when pull private image, below message appreas: F1222 04:12:18.209420 1 builder.go:185] Error: build error: '/var/run/secrets/openshift.io/pull/.dockercfg': open /var/run/secrets/openshift.io/pull/.dockercfg: no such file or directory Version-Release number of selected component (if applicable): openshift v1.1-597-gea98cba kubernetes v1.1.0-origin-1107-g4c8e6f4 etcd 2.1.2 How reproducible: Always Steps to Reproduce: 1. docker login to generate authentication file [root@ip-172-18-7-80 ~]# docker login Username: wzheng Password: Email: wzheng WARNING: login credentials saved in /root/.docker/config.json Login Succeeded 2. Create secret with this file oc secrets new pull /root/.docker/config.json 3. Add the secret to builder service account 4. Add the secret to build strategy in build config file 5. Build with the file Actual results: Build failed for cannot get the authentication, still look for the old file Expected result: Since the file generated by docker login has been changed, build should start to find the file with new location Additional info: a. This option is added when below bug is found: # Create a new .docker/config.json secret named my-secret $ oc secrets new my-secret .dockerconfigjson=path/to/.docker/config.json https://bugzilla.redhat.com/show_bug.cgi?id=1282426 b. Workaround of this issue is to copy the config.json to ~/.dockercfg, then build succeeds
Looks like the environment variables are not set correctly when running docker login. man docker login ... You can log into any public or private repository for which you have credentials. When you log in, the command stores encoded credentials in $HOME/.docker/config.json on Linux or %USERPROFILE%/.docker/conβ fig.json on Windows.
this is the same issue being hit by https://bugzilla.redhat.com/show_bug.cgi?id=1302255 will fix via: https://github.com/openshift/origin/pull/6887
verified in openshift v1.1.1-361-g6408278 kubernetes v1.2.0-alpha.4-851-g4a65fa1 etcd 2.2.2 steps: 1. docker login 2. oc secrets new pull /root/.dockercfg 3. Add the secret to builder service account 4. Add the secret to build strategy in build config file "strategy": { "type": "Source", "sourceStrategy": { "from": { "kind": "DockerImage", "name": "docker.io/wewang58/ruby-20-centos7:latest" }, "pullSecret": { "name": "pull" }, 5. Build with the file and check the log can Pulling Docker image docker.io/wewang58/ruby-20-centos7:latest ... http://pastebin.test.redhat.com/345783 [root@dhcp-128-91 backup]# oc get builds NAME TYPE FROM STATUS STARTED DURATION ruby-sample-build-1 Source Git@00cadc3 Complete 11 minutes ago 1m22s
pls ignore the comment #3
devenv-rhel7_3325 Could pull private image with this two apporachs to create secrets oc secrets new pull ${HOME}/.docker/config.json or oc secrets new pull .dockerconfigjson=${HOME}/.docker/config.json Move bug to verified.