From 053aca1be4985d25c5b362a2b5415d8adb3edd01 Mon Sep 17 00:00:00 2001 From: Vish Date: Fri, 5 Aug 2016 17:15:38 +0530 Subject: [PATCH] #10 encountering issue #11 - to be able to docker push, a credentials is needed to be pre-stored in the jenkins container. - I created a set of credentials (for docker hub) in Jenkins in the credentials module. - this output a credentials.xml in JENKINS_HOME, which I then extracted. - I am pushing this credentials XML into JENKINS_HOME while building the Jenkins image - However, it seems the same encoding is not used everytime so the credentials.xml is not valid across Jenkins installations. - i.e pulling this from one running Jenkins instance, then pushing it into a different instance does not seem to work. As a result, docker push does not work unless you manually edit the credentials through UI before docker-pushing . Notes: - have tried using jenkins-cli. Could not figure out (despite trying for hours) how to use create-credentials-by-xml. - have tried using the docker remote API call as well (curl -X POST /images/name/push). Encountering weird login issue. --- dockerfiles/jenkins-ci/credentials.xml | 19 +++++++++++++++++++ dockerfiles/jenkins-ci/plugins.txt | 6 +++--- 2 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 dockerfiles/jenkins-ci/credentials.xml diff --git a/dockerfiles/jenkins-ci/credentials.xml b/dockerfiles/jenkins-ci/credentials.xml new file mode 100644 index 0000000..5dbfb66 --- /dev/null +++ b/dockerfiles/jenkins-ci/credentials.xml @@ -0,0 +1,19 @@ + + + + + + + + + + GLOBAL + 8301e62d-4eac-4abc-a2c1-fb5ed00aef0e + Docker Hub Vish + docker-username + encoded-password + + + + + diff --git a/dockerfiles/jenkins-ci/plugins.txt b/dockerfiles/jenkins-ci/plugins.txt index 8684c31..389216c 100644 --- a/dockerfiles/jenkins-ci/plugins.txt +++ b/dockerfiles/jenkins-ci/plugins.txt @@ -14,7 +14,7 @@ git-client:1.19.6 ssh-credentials:1.11 matrix-project:1.6 scm-api:1.0 -credentials:1.25 +credentials:2.1.4 workflow-scm-step:1.14.2 git:2.5.3 @@ -23,8 +23,8 @@ git:2.5.3 deploy:1.10 # dependencies for docker build step -authentication-tokens:1.1 -docker-commons:1.2 +authentication-tokens:1.3 +docker-commons:1.4.0 # docker docker-build-step:1.35