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

docker 17.05 multistage Dockerfile breaks dockerFingerprintFrom

    Details

    • Similar Issues:
    • Released As:
      docker-workflow 1.19

      Description

      Docker 17.05 has a new "multi-stage builds" feature. https://docs.docker.com/engine/userguide/eng-image/multistage-build/ Using this feature breaks the dockerFingerprintFrom method with something like

      Cannot retrieve .Id from 'docker inspectphp:7.1-fpm-alpine AS build-env'

        Attachments

          Issue Links

            Activity

            Hide
            brunni Michael Brunner added a comment -

            I just experienced the same issue: 

            java.io.IOException: Cannot retrieve .Id from 'docker inspect nginx:1.17-alpine'
            

            In my Jenkinsfile I have the following code for agent section:

            dockerfile {
                  additionalBuildArgs '--target build-env'
                }
            

            So that only the upper layer is used as docker image for Jenkins and the actual build&test commands from Jenkinsfile are used (instead of the commands from Dockerfile).

            Show
            brunni Michael Brunner added a comment - I just experienced the same issue:  java.io.IOException: Cannot retrieve .Id from 'docker inspect nginx:1.17-alpine' In my Jenkinsfile I have the following code for agent section: dockerfile { additionalBuildArgs '--target build-env' } So that only the upper layer is used as docker image for Jenkins and the actual build&test commands from Jenkinsfile are used (instead of the commands from Dockerfile).
            Hide
            dnusbaum Devin Nusbaum added a comment -

            A fix for this issue was just released in Docker Pipeline plugin version 1.19. From the release notes: 

            Deprecate the dockerFingerprintFrom and dockerFingerprintRun steps and stop calling them during docker.build and image.run. Fixes various issues with Dockerfile parsing and parsing arguments to docker build.

            Show
            dnusbaum Devin Nusbaum added a comment - A fix for this issue was just released in Docker Pipeline plugin version 1.19. From the release notes:  Deprecate the  dockerFingerprintFrom  and  dockerFingerprintRun  steps and stop calling them during  docker.build  and  image.run . Fixes various issues with Dockerfile parsing and parsing arguments to  docker build .
            Hide
            brunni Michael Brunner added a comment -

            Hi, I have docker pipeline plugin version 1.19 running and still have the same issue.
            Is it really resolved? Or am I doing something wrong here.

            [Bitbucket] Build result notified
            11:02:05  java.io.IOException: Cannot retrieve .Id from 'docker inspect nginx:stable-alpine as prod'
            11:02:05  	at org.jenkinsci.plugins.docker.workflow.client.DockerClient.inspectRequiredField(DockerClient.java:220)
            11:02:05  	at org.jenkinsci.plugins.docker.workflow.FromFingerprintStep$Execution.run(FromFingerprintStep.java:118)
            11:02:05  	at org.jenkinsci.plugins.docker.workflow.FromFingerprintStep$Execution.run(FromFingerprintStep.java:88)
            11:02:05  	at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
            11:02:05  	at hudson.security.ACL.impersonate(ACL.java:290)
            11:02:05  	at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
            11:02:05  	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
            11:02:05  	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
            11:02:05  	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
            11:02:05  	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
            11:02:05  	at java.lang.Thread.run(Thread.java:748)
            11:02:05  Finished: FAILURE
            
            Show
            brunni Michael Brunner added a comment - Hi, I have docker pipeline plugin version 1.19 running and still have the same issue. Is it really resolved? Or am I doing something wrong here. [Bitbucket] Build result notified 11:02:05 java.io.IOException: Cannot retrieve .Id from 'docker inspect nginx:stable-alpine as prod' 11:02:05 at org.jenkinsci.plugins.docker.workflow.client.DockerClient.inspectRequiredField(DockerClient.java:220) 11:02:05 at org.jenkinsci.plugins.docker.workflow.FromFingerprintStep$Execution.run(FromFingerprintStep.java:118) 11:02:05 at org.jenkinsci.plugins.docker.workflow.FromFingerprintStep$Execution.run(FromFingerprintStep.java:88) 11:02:05 at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47) 11:02:05 at hudson.security.ACL.impersonate(ACL.java:290) 11:02:05 at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44) 11:02:05 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 11:02:05 at java.util.concurrent.FutureTask.run(FutureTask.java:266) 11:02:05 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 11:02:05 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) 11:02:05 at java.lang. Thread .run( Thread .java:748) 11:02:05 Finished: FAILURE
            Hide
            dnusbaum Devin Nusbaum added a comment -

            Michael Brunner We need to see how you are using the Docker Pipeline Plugin in your Jenkinsfile/shared library to know for sure. If you have a Declarative Pipeline using "agent { docker ... }", your problem should be fixed by https://github.com/jenkinsci/pipeline-model-definition-plugin/pull/350, which has not yet been released.

            Show
            dnusbaum Devin Nusbaum added a comment - Michael Brunner We need to see how you are using the Docker Pipeline Plugin in your Jenkinsfile/shared library to know for sure. If you have a Declarative Pipeline using "agent { docker ... }", your problem should be fixed by https://github.com/jenkinsci/pipeline-model-definition-plugin/pull/350 , which has not yet been released.
            Hide
            brunni Michael Brunner added a comment -

            Thank you for your hint. I'm actually using it in a declarative pipeline manner.

            Show
            brunni Michael Brunner added a comment - Thank you for your hint. I'm actually using it in a declarative pipeline manner.

              People

              • Assignee:
                Unassigned
                Reporter:
                ahammond Andrew Hammond
              • Votes:
                16 Vote for this issue
                Watchers:
                21 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: