Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-41020

CloudBees Docker Build and Publish - Environment Variables

      I'm trying to push to a custom repository,
      however we have several repositories around the globe and I would like the developer to choose to which repo to push.

      I've the plugin 'This project is parameterized'
      I've set 2 parameters :
      1. TAG
      2. REPOSITORY

      When executing a prebuild that do a simple
      'eval docker login $REPOSITORY --username=x --password=x'
      all works perfect

      However,
      Inside cloudbess docker build and publish I've set the repository equal to $REPOSITORY (tried also ${} and $()) that give me an exception as the variable isn't parsed :

      10:37:19 + eval docker login $REPOSITORY --username=x --password=x
      10:37:19 + docker login https://nexus.x.y.com:5000 --username=x --password=x
      10:37:21 Login Succeeded
      10:37:21 ERROR: no protocol: ${REPOSITORY}
      10:37:21 java.net.MalformedURLException: no protocol: ${REPOSITORY}
      10:37:21 	at java.net.URL.<init>(URL.java:593)
      10:37:21 	at java.net.URL.<init>(URL.java:490)
      10:37:21 	at java.net.URL.<init>(URL.java:439)
      10:37:21 	at org.jenkinsci.plugins.docker.commons.credentials.DockerRegistryEndpoint.getEffectiveUrl(DockerRegistryEndpoint.java:136)
      10:37:21 	at org.jenkinsci.plugins.docker.commons.credentials.DockerRegistryEndpoint.imageName(DockerRegistryEndpoint.java:233)
      10:37:21 	at com.cloudbees.dockerpublish.DockerBuilder.getRepo(DockerBuilder.java:252)
      10:37:21 	at com.cloudbees.dockerpublish.DockerBuilder$Perform.getImageTags(DockerBuilder.java:336)
      10:37:21 	at com.cloudbees.dockerpublish.DockerBuilder$Perform.buildAndTag(DockerBuilder.java:370)
      10:37:21 	at com.cloudbees.dockerpublish.DockerBuilder$Perform.exec(DockerBuilder.java:311)
      10:37:21 	at com.cloudbees.dockerpublish.DockerBuilder$Perform.access$100(DockerBuilder.java:291)
      10:37:21 	at com.cloudbees.dockerpublish.DockerBuilder.perform(DockerBuilder.java:262)
      10:37:21 	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      10:37:21 	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
      10:37:21 	at hudson.model.Build$BuildExecution.build(Build.java:205)
      10:37:21 	at hudson.model.Build$BuildExecution.doRun(Build.java:162)
      10:37:21 	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
      10:37:21 	at hudson.model.Run.execute(Run.java:1741)
      10:37:21 	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      10:37:21 	at hudson.model.ResourceController.execute(ResourceController.java:98)
      10:37:21 	at hudson.model.Executor.run(Executor.java:410)
      10:37:21 Build step 'Docker Build and Publish' marked build as failure
      10:37:21 [ssh-agent] Stopped.
      10:37:21 Finished: FAILURE
      

          [JENKINS-41020] CloudBees Docker Build and Publish - Environment Variables

          what plugin version?

          Carlos Sanchez added a comment - what plugin version?

          Yaniv Eliash added a comment -

          1.3.2
          Sorry for not mentioning that.

          Yaniv Eliash added a comment - 1.3.2 Sorry for not mentioning that.

          Adam McNeely added a comment -

          I have the same issue.  If I try to pass in any value for docker URL it strips off the protocol.  In this case I am passing http://docker-local.docker.mydocker.net

           

          I'm also on 1.3.2.

           

           

          GitHub has been notified of this commit’s build result
          
          java.net.MalformedURLException: no protocol: docker-local.docker.mydocker.net
          	at java.net.URL.<init>(URL.java:593)
          	at java.net.URL.<init>(URL.java:490)
          	at java.net.URL.<init>(URL.java:439)
          	at org.jenkinsci.plugins.docker.commons.credentials.DockerRegistryEndpoint.getEffectiveUrl(DockerRegistryEndpoint.java:136)
          	at org.jenkinsci.plugins.docker.commons.credentials.DockerRegistryEndpoint.imageName(DockerRegistryEndpoint.java:238)
          	at org.jenkinsci.plugins.docker.commons.credentials.DockerRegistryEndpoint$imageName$0.call(Unknown Source)
          	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
          	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
          	at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:18)
          	at org.jenkinsci.plugins.docker.workflow.Docker$Image.toQualifiedImageName(jar:file:/var/jenkins_home/plugins/docker-workflow/WEB-INF/lib/docker-workflow.jar!/org/jenkinsci/plugins/docker/workflow/Docker.groovy:108)
          	at org.jenkinsci.plugins.docker.workflow.Docker$Image.tag(jar:file:/var/jenkins_home/plugins/docker-workflow/WEB-INF/lib/docker-workflow.jar!/org/jenkinsci/plugins/docker/workflow/Docker.groovy:161)
          	at org.jenkinsci.plugins.docker.workflow.Docker.node(jar:file:/var/jenkins_home/plugins/docker-workflow/WEB-INF/lib/docker-workflow.jar!/org/jenkinsci/plugins/docker/workflow/Docker.groovy:63)
          	at org.jenkinsci.plugins.docker.workflow.Docker$Image.tag(jar:file:/var/jenkins_home/plugins/docker-workflow/WEB-INF/lib/docker-workflow.jar!/org/jenkinsci/plugins/docker/workflow/Docker.groovy:160)
          	at org.jenkinsci.plugins.docker.workflow.Docker$Image.push(jar:file:/var/jenkins_home/plugins/docker-workflow/WEB-INF/lib/docker-workflow.jar!/org/jenkinsci/plugins/docker/workflow/Docker.groovy:172)
          	at org.jenkinsci.plugins.docker.workflow.Docker.node(jar:file:/var/jenkins_home/plugins/docker-workflow/WEB-INF/lib/docker-workflow.jar!/org/jenkinsci/plugins/docker/workflow/Docker.groovy:63)
          	at org.jenkinsci.plugins.docker.workflow.Docker$Image.push(jar:file:/var/jenkins_home/plugins/docker-workflow/WEB-INF/lib/docker-workflow.jar!/org/jenkinsci/plugins/docker/workflow/Docker.groovy:169)
          	at WorkflowScript.run(WorkflowScript:30)
          	at ___cps.transform___(Native Method)
          	at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:57)
          	at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:109)
          	at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:82)
          	at sun.reflect.GeneratedMethodAccessor606.invoke(Unknown Source)
          	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          	at java.lang.reflect.Method.invoke(Method.java:498)
          	at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
          	at com.cloudbees.groovy.cps.impl.LocalVariableBlock$LocalVariable.get(LocalVariableBlock.java:39)
          	at com.cloudbees.groovy.cps.LValueBlock$GetAdapter.receive(LValueBlock.java:30)
          	at com.cloudbees.groovy.cps.impl.LocalVariableBlock.evalLValue(LocalVariableBlock.java:28)
          	at com.cloudbees.groovy.cps.LValueBlock$BlockImpl.eval(LValueBlock.java:55)
          	at com.cloudbees.groovy.cps.LValueBlock.eval(LValueBlock.java:16)
          	at com.cloudbees.groovy.cps.Next.step(Next.java:74)
          	at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:154)
          	at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:18)
          	at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:33)
          	at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:30)
          	at 
          

           

          Adam McNeely added a comment - I have the same issue.  If I try to pass in any value for docker URL it strips off the protocol.  In this case I am passing http://docker-local.docker.mydocker.net   I'm also on 1.3.2.     GitHub has been notified of this commit’s build result java.net.MalformedURLException: no protocol: docker-local.docker.mydocker.net at java.net.URL.<init>(URL.java:593) at java.net.URL.<init>(URL.java:490) at java.net.URL.<init>(URL.java:439) at org.jenkinsci.plugins.docker.commons.credentials.DockerRegistryEndpoint.getEffectiveUrl(DockerRegistryEndpoint.java:136) at org.jenkinsci.plugins.docker.commons.credentials.DockerRegistryEndpoint.imageName(DockerRegistryEndpoint.java:238) at org.jenkinsci.plugins.docker.commons.credentials.DockerRegistryEndpoint$imageName$0.call(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113) at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:18) at org.jenkinsci.plugins.docker.workflow.Docker$Image.toQualifiedImageName(jar:file:/ var /jenkins_home/plugins/docker-workflow/WEB-INF/lib/docker-workflow.jar!/org/jenkinsci/plugins/docker/workflow/Docker.groovy:108) at org.jenkinsci.plugins.docker.workflow.Docker$Image.tag(jar:file:/ var /jenkins_home/plugins/docker-workflow/WEB-INF/lib/docker-workflow.jar!/org/jenkinsci/plugins/docker/workflow/Docker.groovy:161) at org.jenkinsci.plugins.docker.workflow.Docker.node(jar:file:/ var /jenkins_home/plugins/docker-workflow/WEB-INF/lib/docker-workflow.jar!/org/jenkinsci/plugins/docker/workflow/Docker.groovy:63) at org.jenkinsci.plugins.docker.workflow.Docker$Image.tag(jar:file:/ var /jenkins_home/plugins/docker-workflow/WEB-INF/lib/docker-workflow.jar!/org/jenkinsci/plugins/docker/workflow/Docker.groovy:160) at org.jenkinsci.plugins.docker.workflow.Docker$Image.push(jar:file:/ var /jenkins_home/plugins/docker-workflow/WEB-INF/lib/docker-workflow.jar!/org/jenkinsci/plugins/docker/workflow/Docker.groovy:172) at org.jenkinsci.plugins.docker.workflow.Docker.node(jar:file:/ var /jenkins_home/plugins/docker-workflow/WEB-INF/lib/docker-workflow.jar!/org/jenkinsci/plugins/docker/workflow/Docker.groovy:63) at org.jenkinsci.plugins.docker.workflow.Docker$Image.push(jar:file:/ var /jenkins_home/plugins/docker-workflow/WEB-INF/lib/docker-workflow.jar!/org/jenkinsci/plugins/docker/workflow/Docker.groovy:169) at WorkflowScript.run(WorkflowScript:30) at ___cps.transform___(Native Method) at com.cloudbees.groovy.cps.impl.ContinuationGroup.methodCall(ContinuationGroup.java:57) at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.dispatchOrArg(FunctionCallBlock.java:109) at com.cloudbees.groovy.cps.impl.FunctionCallBlock$ContinuationImpl.fixArg(FunctionCallBlock.java:82) at sun.reflect.GeneratedMethodAccessor606.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72) at com.cloudbees.groovy.cps.impl.LocalVariableBlock$LocalVariable.get(LocalVariableBlock.java:39) at com.cloudbees.groovy.cps.LValueBlock$GetAdapter.receive(LValueBlock.java:30) at com.cloudbees.groovy.cps.impl.LocalVariableBlock.evalLValue(LocalVariableBlock.java:28) at com.cloudbees.groovy.cps.LValueBlock$BlockImpl.eval(LValueBlock.java:55) at com.cloudbees.groovy.cps.LValueBlock.eval(LValueBlock.java:16) at com.cloudbees.groovy.cps.Next.step(Next.java:74) at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:154) at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:18) at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:33) at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:30) at  

          Swapnil Verma added a comment -

          I'm facing same issue as reported by other users on version 1.3.2.

          I have set my env variable as, but it seems it is not been evaluated.

          AWS_DOCKER_REGISTRY_URL=https://something.com
          
          
          
          ERROR: no protocol: ${AWS_DOCKER_REGISTRY_URL}
          java.net.MalformedURLException: no protocol: ${AWS_DOCKER_REGISTRY_URL}
          	at java.net.URL.<init>(URL.java:593)
          	at java.net.URL.<init>(URL.java:490)
          	at java.net.URL.<init>(URL.java:439)
          	at org.jenkinsci.plugins.docker.commons.credentials.DockerRegistryEndpoint.getEffectiveUrl(DockerRegistryEndpoint.java:136)
          	at org.jenkinsci.plugins.docker.commons.credentials.DockerRegistryEndpoint.imageName(DockerRegistryEndpoint.java:238)
          	at com.cloudbees.dockerpublish.DockerBuilder.getRepo(DockerBuilder.java:252)
          	at com.cloudbees.dockerpublish.DockerBuilder$Perform.getImageTags(DockerBuilder.java:336)
          	at com.cloudbees.dockerpublish.DockerBuilder$Perform.exec(DockerBuilder.java:305)
          	at com.cloudbees.dockerpublish.DockerBuilder$Perform.access$100(DockerBuilder.java:291)
          	at com.cloudbees.dockerpublish.DockerBuilder.perform(DockerBuilder.java:262)
          	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
          	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
          	at hudson.model.Build$BuildExecution.build(Build.java:206)
          	at hudson.model.Build$BuildExecution.doRun(Build.java:163)
          	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
          	at hudson.model.Run.execute(Run.java:1728)
          	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
          	at hudson.model.ResourceController.execute(ResourceController.java:98)
          	at hudson.model.Executor.run(Executor.java:405)
          Build step 'Docker Build and Publish' marked build as failure
          

          Swapnil Verma added a comment - I'm facing same issue as reported by other users on version 1.3.2. I have set my env variable as, but it seems it is not been evaluated. AWS_DOCKER_REGISTRY_URL=https: //something.com ERROR: no protocol: ${AWS_DOCKER_REGISTRY_URL} java.net.MalformedURLException: no protocol: ${AWS_DOCKER_REGISTRY_URL} at java.net.URL.<init>(URL.java:593) at java.net.URL.<init>(URL.java:490) at java.net.URL.<init>(URL.java:439) at org.jenkinsci.plugins.docker.commons.credentials.DockerRegistryEndpoint.getEffectiveUrl(DockerRegistryEndpoint.java:136) at org.jenkinsci.plugins.docker.commons.credentials.DockerRegistryEndpoint.imageName(DockerRegistryEndpoint.java:238) at com.cloudbees.dockerpublish.DockerBuilder.getRepo(DockerBuilder.java:252) at com.cloudbees.dockerpublish.DockerBuilder$Perform.getImageTags(DockerBuilder.java:336) at com.cloudbees.dockerpublish.DockerBuilder$Perform.exec(DockerBuilder.java:305) at com.cloudbees.dockerpublish.DockerBuilder$Perform.access$100(DockerBuilder.java:291) at com.cloudbees.dockerpublish.DockerBuilder.perform(DockerBuilder.java:262) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779) at hudson.model.Build$BuildExecution.build(Build.java:206) at hudson.model.Build$BuildExecution.doRun(Build.java:163) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534) at hudson.model.Run.execute(Run.java:1728) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:405) Build step 'Docker Build and Publish' marked build as failure

          Wen Gong added a comment -

          Hi, 

          I try to follow AWS guide on using jenkins to publish docker image and hit this same issue

          I'm also on 1.3.2. - CloudBees Docker Build and Publish plugin

          below is the actual build log

          Started by GitHub push by wgongStarted by GitHub push by wgongBuilding in workspace /var/lib/jenkins/workspace/hello-aws-docker-git > git rev-parse --is-inside-work-tree # timeout=10Fetching changes from the remote Git repository > git config remote.origin.url https://github.com/wgong/hello-aws-docker.git # timeout=10Fetching upstream changes from https://github.com/wgong/hello-aws-docker.git > git --version # timeout=10 > git fetch --tags --progress https://github.com/wgong/hello-aws-docker.git +refs/heads/:refs/remotes/origin/ > git rev-parse refs/remotes/origin/master^{commit} # timeout=10 > git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10Checking out Revision dff69d8be12db823e082a159214546c3d05f9f58 (refs/remotes/origin/master) > git config core.sparsecheckout # timeout=10 > git checkout -f dff69d8be12db823e082a159214546c3d05f9f58Commit message: "test 6" > git rev-list --no-walk 6f01d33824f6be982da4a82074578ad82c27315d # timeout=10[hello-aws-docker-git] $ /bin/bash /tmp/jenkins4612168405221345018.shWARNING! Using --password via the CLI is insecure. Use --password-stdin.WARNING! Your password will be stored unencrypted in /var/lib/jenkins/.docker/config.json.Configure a credential helper to remove this warning. Seehttps://docs.docker.com/engine/reference/commandline/login/#credentials-store
          Login SucceededERROR: no protocol: 629309645488.dkr.ecr.us-east-1.amazonaws.com/java.net.MalformedURLException: no protocol: 629309645488.dkr.ecr.us-east-1.amazonaws.com/ at java.net.URL.<init>(URL.java:593) at java.net.URL.<init>(URL.java:490) at java.net.URL.<init>(URL.java:439) at org.jenkinsci.plugins.docker.commons.credentials.DockerRegistryEndpoint.getEffectiveUrl(DockerRegistryEndpoint.java:139) at org.jenkinsci.plugins.docker.commons.credentials.DockerRegistryEndpoint.imageName(DockerRegistryEndpoint.java:266) at com.cloudbees.dockerpublish.DockerBuilder.getRepo(DockerBuilder.java:252) at com.cloudbees.dockerpublish.DockerBuilder$Perform.getImageTags(DockerBuilder.java:336) at com.cloudbees.dockerpublish.DockerBuilder$Perform.exec(DockerBuilder.java:305) at com.cloudbees.dockerpublish.DockerBuilder$Perform.access$100(DockerBuilder.java:291) at com.cloudbees.dockerpublish.DockerBuilder.perform(DockerBuilder.java:262) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744) at hudson.model.Build$BuildExecution.build(Build.java:206) at hudson.model.Build$BuildExecution.doRun(Build.java:163) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504) at hudson.model.Run.execute(Run.java:1810) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:429)Build step 'Docker Build and Publish' marked build as failureFinished: FAILURE

           

          I am available to help with reproducing this issue on AWS

          Please suggest any workaround since it was reported 1 year ago

           

          Thanks

          Wen

           

          Wen Gong added a comment - Hi,  I try to follow AWS guide on using jenkins to publish docker image and hit this same issue I'm also on 1.3.2. -  CloudBees Docker Build and Publish plugin below is the actual build log Started by GitHub push by wgongStarted by GitHub push by wgongBuilding in workspace /var/lib/jenkins/workspace/hello-aws-docker-git > git rev-parse --is-inside-work-tree # timeout=10Fetching changes from the remote Git repository > git config remote.origin.url https://github.com/wgong/hello-aws-docker.git # timeout=10Fetching upstream changes from https://github.com/wgong/hello-aws-docker.git  > git --version # timeout=10 > git fetch --tags --progress https://github.com/wgong/hello-aws-docker.git +refs/heads/ :refs/remotes/origin/  > git rev-parse refs/remotes/origin/master^{commit} # timeout=10 > git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10Checking out Revision dff69d8be12db823e082a159214546c3d05f9f58 (refs/remotes/origin/master) > git config core.sparsecheckout # timeout=10 > git checkout -f dff69d8be12db823e082a159214546c3d05f9f58Commit message: "test 6" > git rev-list --no-walk 6f01d33824f6be982da4a82074578ad82c27315d # timeout=10 [hello-aws-docker-git] $ /bin/bash /tmp/jenkins4612168405221345018.shWARNING! Using --password via the CLI is insecure. Use --password-stdin.WARNING! Your password will be stored unencrypted in /var/lib/jenkins/.docker/config.json.Configure a credential helper to remove this warning. Seehttps://docs.docker.com/engine/reference/commandline/login/#credentials-store Login SucceededERROR: no protocol: 629309645488.dkr.ecr.us-east-1.amazonaws.com/java.net.MalformedURLException: no protocol: 629309645488.dkr.ecr.us-east-1.amazonaws.com/ at java.net.URL.<init>(URL.java:593) at java.net.URL.<init>(URL.java:490) at java.net.URL.<init>(URL.java:439) at org.jenkinsci.plugins.docker.commons.credentials.DockerRegistryEndpoint.getEffectiveUrl(DockerRegistryEndpoint.java:139) at org.jenkinsci.plugins.docker.commons.credentials.DockerRegistryEndpoint.imageName(DockerRegistryEndpoint.java:266) at com.cloudbees.dockerpublish.DockerBuilder.getRepo(DockerBuilder.java:252) at com.cloudbees.dockerpublish.DockerBuilder$Perform.getImageTags(DockerBuilder.java:336) at com.cloudbees.dockerpublish.DockerBuilder$Perform.exec(DockerBuilder.java:305) at com.cloudbees.dockerpublish.DockerBuilder$Perform.access$100(DockerBuilder.java:291) at com.cloudbees.dockerpublish.DockerBuilder.perform(DockerBuilder.java:262) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744) at hudson.model.Build$BuildExecution.build(Build.java:206) at hudson.model.Build$BuildExecution.doRun(Build.java:163) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504) at hudson.model.Run.execute(Run.java:1810) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:429)Build step 'Docker Build and Publish' marked build as failureFinished: FAILURE   I am available to help with reproducing this issue on AWS Please suggest any workaround since it was reported 1 year ago   Thanks Wen  

          The workaround (and common usage these days IMHO) is to run docker login, build and push with the sh step

          Carlos Sanchez added a comment - The workaround (and common usage these days IMHO) is to run docker login, build and push with the sh step

          Wen Gong added a comment -

          Thanks, your workaround was fine.

          TAG_NAME=${REPOSITORY_NAME}:v_${BUILD_NUMBER}
          IMG_NAME=${REPOSITORY_URI}:v_${BUILD_NUMBER}
          docker build --tag=${TAG_NAME} .
          docker tag ${TAG_NAME} ${IMG_NAME}
          docker push ${IMG_NAME}

           

          Wen Gong added a comment - Thanks, your workaround was fine. TAG_NAME=${REPOSITORY_NAME}:v_${BUILD_NUMBER} IMG_NAME=${REPOSITORY_URI}:v_${BUILD_NUMBER} docker build --tag=${TAG_NAME} . docker tag ${TAG_NAME} ${IMG_NAME} docker push ${IMG_NAME}  

            Unassigned Unassigned
            geostant Yaniv Eliash
            Votes:
            2 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated: