-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
CloudBees Docker Workflow 1.2
Workflow 1.10.1
Jenkins 1.631
centos7
When we use some images like 'centos:centos7', 'nodesource/centos7:0.12.7' or 'nodesource/jessie:0.12.7', it throws an exception when try to inspect the Id from the source:
Example:
FROM nodesource/centos7:0.12.7
RUN yum install -y epel-release
RUN yum install -y npm
Exception:
Running: Record trace of a Docker image used in FROM
Running: Allocate node : Body : End
Running: Allocate node : End
Running: End of Workflow
java.io.IOException: Cannot retrieve .Id from 'docker inspect centos:centos7'
at org.jenkinsci.plugins.docker.workflow.client.DockerClient.inspectRequiredField(DockerClient.java:176)
at org.jenkinsci.plugins.docker.workflow.FromFingerprintStep$Execution.run(FromFingerprintStep.java:114)
at org.jenkinsci.plugins.docker.workflow.FromFingerprintStep$Execution.run(FromFingerprintStep.java:74)
at org.jenkinsci.plugins.workflow.steps.AbstractSynchronousStepExecution.start(AbstractSynchronousStepExecution.java:40)
at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:136)
at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:112)
Thanks,
Henrique
I'm seeing a similar error, but I think the root cause in my case is different.
My pipeline has the following:
and the logs show this, (notice there is no space at all between the image name)
Cannot retrieve .Id from 'docker inspecttest/example:123
docker build -t test/example:123 . Sending build context to Docker daemon 25.35 MB Step 1 : FROM alpine:latest ---> 4a415e366388 Step 2 : MAINTAINER ... Step 6 : ENTRYPOINT /docker-entrypoint.sh ---> Running in 7a1c46850107 ---> fb2dfcecf73a Removing intermediate container 7a1c46850107 Successfully built fb2dfcecf73a [Pipeline] dockerFingerprintFrom Executing command: docker inspect -f {{.Id}} test/example:123 java.io.IOException: Cannot retrieve .Id from 'docker inspecttest/example:123' at org.jenkinsci.plugins.docker.workflow.client.DockerClient.inspectRequiredField(DockerClient.java:192) 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
I've settled on a work-around by doing:
sh "docker build -t ${imageName} ." def img = docker.image(imageName)