• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • docker-workflow-plugin
    • None
    • docker 17.05+
    • docker-workflow 1.18

      Taking advantage of https://github.com/moby/moby/issues/18119 is not supported by docker.build.

      Minimal docker file 

      ARG TAG
      FROM image:${TAG}
      

       
      Docker build

      docker.build("image_name", "--build-arg TAG=${package_version} -f Dockerfile .")
      

       

      Stacktrace

      java.io.IOException: Cannot retrieve .Id from 'docker inspectimage:${TAG}'
              at org.jenkinsci.plugins.docker.workflow.client.DockerClient.inspectRequiredField(DockerClient.java:203)
              at org.jenkinsci.plugins.docker.workflow.FromFingerprintStep$Execution.run(FromFingerprintStep.java:119)
              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)
      

          [JENKINS-46105] Docker 17.05 ARG in FROM breaks docker inspect

          Robby Pocase created issue -
          Nuno Costa made changes -
          Link New: This issue duplicates JENKINS-44836 [ JENKINS-44836 ]

          Hello,

          Same situation here:

          java.io.IOException: Cannot retrieve .Id from 'docker inspectnode:${NODE_VERSION}'
          	at org.jenkinsci.plugins.docker.workflow.client.DockerClient.inspectRequiredField(DockerClient.java:203)
          	at org.jenkinsci.plugins.docker.workflow.FromFingerprintStep$Execution.run(FromFingerprintStep.java:119)
          	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:1149)
          	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
          	at java.lang.Thread.run(Thread.java:748)
          Finished: FAILURE
          

          The workflow can't handle ARG variable properly here:

          ARG NODE_VERSION=8.5
          FROM node:${NODE_VERSION}

          Grzegorz Szczudlik added a comment - Hello, Same situation here: java.io.IOException: Cannot retrieve .Id from 'docker inspectnode:${NODE_VERSION}' at org.jenkinsci.plugins.docker.workflow.client.DockerClient.inspectRequiredField(DockerClient.java:203) at org.jenkinsci.plugins.docker.workflow.FromFingerprintStep$Execution.run(FromFingerprintStep.java:119) 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:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang. Thread .run( Thread .java:748) Finished: FAILURE The workflow can't handle ARG variable properly here: ARG NODE_VERSION=8.5 FROM node:${NODE_VERSION}
          Christoph Linder made changes -
          Priority Original: Minor [ 4 ] New: Major [ 3 ]

          FromFingerprintStep does not account for placeholders.

           

          I implemented a fix:

          https://github.com/jenkinsci/docker-workflow-plugin/pull/118

           

          Christoph Linder added a comment - FromFingerprintStep does not account for placeholders.   I implemented a fix: https://github.com/jenkinsci/docker-workflow-plugin/pull/118  

          Code changed in jenkins
          User: Christoph Linder
          Path:
          src/main/java/org/jenkinsci/plugins/docker/workflow/DockerUtils.java
          src/main/java/org/jenkinsci/plugins/docker/workflow/FromFingerprintStep.java
          src/main/resources/org/jenkinsci/plugins/docker/workflow/Docker.groovy
          src/test/java/org/jenkinsci/plugins/docker/workflow/FromFingerprintStepTest.java
          http://jenkins-ci.org/commit/docker-workflow-plugin/35caf3faddf931dc49ee0182d4161380b2a541cb
          Log:
          JENKINS-46105 Docker 17.05 ARG in FROM breaks docker inspect

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christoph Linder Path: src/main/java/org/jenkinsci/plugins/docker/workflow/DockerUtils.java src/main/java/org/jenkinsci/plugins/docker/workflow/FromFingerprintStep.java src/main/resources/org/jenkinsci/plugins/docker/workflow/Docker.groovy src/test/java/org/jenkinsci/plugins/docker/workflow/FromFingerprintStepTest.java http://jenkins-ci.org/commit/docker-workflow-plugin/35caf3faddf931dc49ee0182d4161380b2a541cb Log: JENKINS-46105 Docker 17.05 ARG in FROM breaks docker inspect

          Code changed in jenkins
          User: Christoph Linder
          Path:
          .editorconfig
          src/main/java/org/jenkinsci/plugins/docker/workflow/DockerUtils.java
          src/test/java/org/jenkinsci/plugins/docker/workflow/FromFingerprintStepTest.java
          http://jenkins-ci.org/commit/docker-workflow-plugin/c7ceba43900d3160eab695167a5588ad10f7e9c5
          Log:
          JENKINS-46105 Docker 17.05 ARG in FROM breaks docker inspect (adhere to coding standards)

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christoph Linder Path: .editorconfig src/main/java/org/jenkinsci/plugins/docker/workflow/DockerUtils.java src/test/java/org/jenkinsci/plugins/docker/workflow/FromFingerprintStepTest.java http://jenkins-ci.org/commit/docker-workflow-plugin/c7ceba43900d3160eab695167a5588ad10f7e9c5 Log: JENKINS-46105 Docker 17.05 ARG in FROM breaks docker inspect (adhere to coding standards)

          Code changed in jenkins
          User: Christoph Linder
          Path:
          src/main/java/org/jenkinsci/plugins/docker/workflow/DockerUtils.java
          http://jenkins-ci.org/commit/docker-workflow-plugin/b07130ba576034a8731c436b85d5b087ceaed62e
          Log:
          JENKINS-46105 Docker 17.05 ARG in FROM breaks docker inspect (Jenkins fail)

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christoph Linder Path: src/main/java/org/jenkinsci/plugins/docker/workflow/DockerUtils.java http://jenkins-ci.org/commit/docker-workflow-plugin/b07130ba576034a8731c436b85d5b087ceaed62e Log: JENKINS-46105 Docker 17.05 ARG in FROM breaks docker inspect (Jenkins fail)

          Code changed in jenkins
          User: Andrew Bayer
          Path:
          .editorconfig
          src/main/java/org/jenkinsci/plugins/docker/workflow/DockerUtils.java
          src/main/java/org/jenkinsci/plugins/docker/workflow/FromFingerprintStep.java
          src/main/resources/org/jenkinsci/plugins/docker/workflow/Docker.groovy
          src/test/java/org/jenkinsci/plugins/docker/workflow/FromFingerprintStepTest.java
          http://jenkins-ci.org/commit/docker-workflow-plugin/0e95d9409eb7d219dd9f4f37383c5321c630b889
          Log:
          Merge pull request #118 from HonoluluHenk/fix-dynamic-FROM-in-build-fingerprinting

          JENKINS-46105 Docker 17.05 ARG in FROM breaks docker inspect

          Compare: https://github.com/jenkinsci/docker-workflow-plugin/compare/8a8644434925...0e95d9409eb7

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Andrew Bayer Path: .editorconfig src/main/java/org/jenkinsci/plugins/docker/workflow/DockerUtils.java src/main/java/org/jenkinsci/plugins/docker/workflow/FromFingerprintStep.java src/main/resources/org/jenkinsci/plugins/docker/workflow/Docker.groovy src/test/java/org/jenkinsci/plugins/docker/workflow/FromFingerprintStepTest.java http://jenkins-ci.org/commit/docker-workflow-plugin/0e95d9409eb7d219dd9f4f37383c5321c630b889 Log: Merge pull request #118 from HonoluluHenk/fix-dynamic-FROM-in-build-fingerprinting JENKINS-46105 Docker 17.05 ARG in FROM breaks docker inspect Compare: https://github.com/jenkinsci/docker-workflow-plugin/compare/8a8644434925...0e95d9409eb7

          Andrew Bayer added a comment -

          Will be in next release - 1.15.

          Andrew Bayer added a comment - Will be in next release - 1.15.
          Andrew Bayer made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]

            abayer Andrew Bayer
            rpocase Robby Pocase
            Votes:
            9 Vote for this issue
            Watchers:
            16 Start watching this issue

              Created:
              Updated:
              Resolved: