dockerFingerprintFrom when the Dockerfile uses an ARG is not working from a pipeline

22 views
Skip to first unread message

denis.a...@dematic.com

unread,
Jan 11, 2018, 6:37:11 PM1/11/18
to Jenkins Users
Hi

I have started using a Dockerfile build argument to simplify my dependencies between images.


Namely, I have Dockerfile to build the image "secret_project/name" looking like:

ARG parent_version
FROM secret_project/parent_name:${parent_version}


My jenkins pipeline lets maven build the docker image.
Once maven finishes, I want to use dockerFingerprintFrom


In my Jenkinsfile, I have:

dockerFingerprintFrom dockerfile: filePath, image: docker.image("secret_project/name").id


and the pipeline fails with:


java.io.IOException: Cannot retrieve .Id from 'docker inspect secret_project/parent_name:${parent_version}'


Looking around, I see that this bug has been fixed already by "JENKINS-46105 Docker 17.05 ARG in FROM breaks docker inspect" <https://github.com/jenkinsci/docker-workflow-plugin/commit/35caf3faddf931dc49ee0182d4161380b2a541cb#diff-1d13cd3a55819d1da5ac7b25f232e43d>


But I can't get it to work!


I have the exact same error with
dockerFingerprintFrom dockerfile: filePath, image: docker.image("secret_project/name").id, buildArgs: ['parent_version': version]


How can I add the buildArgs to the dockerFingerprintFrom ?


Thanks
    dna




Reply all
Reply to author
Forward
0 new messages