From b309f60d3ce7c2e3e20de18cebc18668d31e6d2a Mon Sep 17 00:00:00 2001 From: Parris Varney Date: Mon, 17 Jul 2017 14:00:13 -0400 Subject: [PATCH] Added Docker Pipeline example to README.md --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index 07aac03..6c9e733 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,19 @@ Then, in the "Docker Credential" dropdown, select your account marked as "Google Save your configuration and run your job. +### Note when using [Cloudbees Docker Pipeline Plugin](https://wiki.jenkins.io/display/JENKINS/Docker+Pipeline+Plugin) + +The Jenkins credentials ID needs to be prefixed with `gcr:` to work with the Cloudbees Docker Pipeline Plugin. So, for example, if you named your credentials "google-container-registry-project", then your Jenkinsfile should look like the following: + +```groovy + stage('Push images') { + docker.withRegistry('https://us.gcr.io', 'gcr:google-container-registry-project') { + myContainer.push("${env.BUILD_NUMBER}") + myContainer.push("latest") + } + } +``` + Security Warning === Docker Build Step Plugin will pass the credentials to Docker server daemon. If the Docker server daemon listens on HTTP port without using TLS, this will create a security hole because the credentials (not encrypted, only base64 encoded) can be intercepted via the HTTP traffic. This is a problem of Docker itself. Configuring the Docker server daemon to listen on HTTP port without using TLS is strongly discouraged. When communication to Docker daemon on a remote machine is needed, the traffic can be secured by HTTPS, see Docker's documentation: http://docs.docker.com/articles/https/.