adoptium / ci-jenkins-pipelines

jenkins pipeline build scripts
Apache License 2.0
19 stars 70 forks source link

riscv64 builds (or any using docker image tag or digest) broken #1082

Closed andrew-m-leonard closed 2 months ago

andrew-m-leonard commented 2 months ago

PR: https://github.com/adoptium/ci-jenkins-pipelines/pull/1076 added a patch to tag using the docker_image to handle scenario when using a dockerRegistry. However, it searches the image ls using the docker_image, which may contain a :tag or @digest, which will not match... eg: https://ci.adoptium.net/job/build-scripts/job/jobs/job/jdk23/job/jdk23-linux-riscv64-temurin/9/console

10:11:32  + docker image ls
10:11:32  + grep adoptopenjdk/ubuntu2004_build_image:linux-riscv64
10:11:32  + head -n1
10:11:32  + awk {print $1}
[Pipeline] sh
10:11:34  + docker tag  adoptopenjdk/ubuntu2004_build_image:linux-riscv64
10:11:34  Error parsing reference: "" is not a valid repository/tag: invalid reference format

docker ls returns the "Repository", you can't locate the entry you need from that list using the plain DOCKER_IMAGE string

sxa commented 2 months ago

Took me a bit of time to understand the specific problem here, but for historic reference it is because docker image ls gives lines like this:

adoptopenjdk/ubuntu2004_build_image           linux-riscv64   d7f86236b5fd   5 days ago       3.01GB

which the grep with the colon separation between image and tag will not pick up.