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

docker 17.05 multistage Dockerfile breaks dockerFingerprintFrom

    XMLWordPrintable

    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
            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 ?  
            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 .

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: