Commit 1bb5ff14 authored by Emanuele Aina's avatar Emanuele Aina

Jenkinsfile: Workaround failure with multistage Dockerfile

The Jenkins Docker workflow plugin fails badly when trying to inspect
the built images when using a multi-stage `Dockerfile`.

That's because the plugins naively looks for the image name by taking
*all* the contents after `FROM `, which means it breaks whether a stage
name is introduced with `AS stagename` or even if more than a single
space is used after `FROM`.


Invoking `docker` directly as suggested on the JIRA issue works around
the problem.
Signed-off-by: Emanuele Aina's avatarEmanuele Aina <>
parent b3f70611
Pipeline #3102 passed with stage
in 1 minute and 28 seconds
......@@ -13,9 +13,11 @@ def definitions = [
def buildContainer(directory, name, upload = false) {
docker.withRegistry("https://${registry}", registrycred) {
d ="${registry}/${name}", "--no-cache ${directory}")
// don't use due to Jenkins failing on multi-stage Dockerfiles
sh "docker build -t ${registry}/${name} --no-cache ${directory}"
if (upload) {
sh "docker push ${registry}/${name}"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment