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

            ahammond Andrew Hammond created issue -
            philster_jenkins Phil Clay made changes -
            Field Original Value New Value
            Link This issue relates to JENKINS-44609 [ JENKINS-44609 ]
            jglick Jesse Glick made changes -
            Status Open [ 1 ] Resolved [ 5 ]
            Resolution Duplicate [ 3 ]
            Hide
            ahammond Andrew Hammond added a comment -

            Duplicate of what ticket please?

            Show
            ahammond Andrew Hammond added a comment - Duplicate of what ticket please?
            Hide
            ahammond Andrew Hammond added a comment -

            Oh, mobile version his it but found it. Thanks!

            Show
            ahammond Andrew Hammond added a comment - Oh, mobile version his it but found it. Thanks!
            Hide
            chinakevinguo kevin guo added a comment -

            I have a problem about dockerFingerprintFrom

            Dockerfile:

             

            FROM 172.30.33.31:5000/base/jdk:8u74
            

             

             

            Jenkinsfile:

             

            node {
              stage("First stage") {
                dockerFingerprintFrom([dockerfile: "."])
              }
            }

             

            but i have an error as follows:

             

            java.io.IOException: Cannot retrieve .Id from 'docker inspectnull'
            	at org.jenkinsci.plugins.docker.workflow.client.DockerClient.inspectRequiredField(DockerClient.java:203)
            	at org.jenkinsci.plugins.docker.workflow.FromFingerprintStep$Execution.run(FromFingerprintStep.java:115)
            	at org.jenkinsci.plugins.docker.workflow.FromFingerprintStep$Execution.run(FromFingerprintStep.java:75)
            	at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47)
            	at hudson.security.ACL.impersonate(ACL.java:260)
            	at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44)
            	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
            	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
            	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
            	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
            	at java.lang.Thread.run(Thread.java:745)
            Finished: FAILURE
            

             

            It does not work I don't even know if this correct ... I would like ask if anyone has a practical example to show me ?

             

            Show
            chinakevinguo kevin guo added a comment - I have a problem about dockerFingerprintFrom Dockerfile:   FROM 172.30.33.31:5000/base/jdk:8u74     Jenkinsfile:   node { stage( "First stage" ) { dockerFingerprintFrom([dockerfile: "." ]) } }   but i have an error as follows:   java.io.IOException: Cannot retrieve .Id from 'docker inspectnull' at org.jenkinsci.plugins.docker.workflow.client.DockerClient.inspectRequiredField(DockerClient.java:203) at org.jenkinsci.plugins.docker.workflow.FromFingerprintStep$Execution.run(FromFingerprintStep.java:115) at org.jenkinsci.plugins.docker.workflow.FromFingerprintStep$Execution.run(FromFingerprintStep.java:75) at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1$1.call(AbstractSynchronousNonBlockingStepExecution.java:47) at hudson.security.ACL.impersonate(ACL.java:260) at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution$1.run(AbstractSynchronousNonBlockingStepExecution.java:44) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang. Thread .run( Thread .java:745) Finished: FAILURE   It does not work I don't even know if this correct ... I would like ask if anyone has a practical example to show me ?  
            chinakevinguo kevin guo made changes -
            Resolution Duplicate [ 3 ]
            Status Resolved [ 5 ] Reopened [ 4 ]
            Hide
            ahammond Andrew Hammond added a comment -

            +1 with the following FROM line:

            FROM quay.io/prometheus/golang-builder:1.9-base
            Show
            ahammond Andrew Hammond added a comment - +1 with the following FROM line: FROM quay.io/prometheus/golang-builder:1.9-base
            Hide
            ahammond Andrew Hammond added a comment -

            At the very least can we please disable this functionality since it doesn't provide value and appears to create issues.

            Show
            ahammond Andrew Hammond added a comment - At the very least can we please disable this functionality since it doesn't provide value and appears to create issues.
            Hide
            dbensoussan david bensoussan added a comment -

            There is a PR solving this here: https://github.com/jenkinsci/docker-workflow-plugin/pull/162

            Could a maintainer take a look at it?

            Show
            dbensoussan david bensoussan added a comment - There is a PR solving this here: https://github.com/jenkinsci/docker-workflow-plugin/pull/162 Could a maintainer take a look at it?
            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 .
            dnusbaum Devin Nusbaum made changes -
            Status Reopened [ 4 ] Resolved [ 5 ]
            Resolution Duplicate [ 3 ]
            Released As docker-workflow 1.19
            dnusbaum Devin Nusbaum made changes -
            Link This issue relates to JENKINS-44609 [ JENKINS-44609 ]
            dnusbaum Devin Nusbaum made changes -
            Link This issue duplicates JENKINS-44609 [ JENKINS-44609 ]
            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: