Unable build docker image for Devsecops course

Hello,

I’m facing issue, building image for devsecops course. Please find below error.

=> ERROR [3/3] COPY target/*.jar /home/k8s-pipeline/app.jar 0.9s

[3/3] COPY target/*.jar /home/k8s-pipeline/app.jar:


Dockerfile:5

3 | ARG JAR_FILE=target/*.jar
4 | RUN addgroup -S pipeline && adduser -S k8s-pipeline -G pipeline
5 | >>> COPY ${JAR_FILE} /home/k8s-pipeline/app.jar
6 | USER k8s-pipeline
7 | ENTRYPOINT [“java”,“-jar”,“/home/k8s-pipeline/app.jar”]

ERROR: failed to solve: lstat /var/lib/docker/tmp/buildkit-mount3223575882/target: no such file or directory

in the repository there is no target dorectory.

Please help me how can i resolve this issue.

BR
Rafi

Hello

Which lab is this? Link please.

Hello Alistair,

The lab is working fine, but the repositories provided for personal lab are incomplete, missing target directory and jar file for building docker image.

Below is the link for course github repositories.

I’ve tried building with both repositories but same error for the jar file and target directory, those are note present in repositories.

BR
Rafi