I am following spring io article on how to use docker for spring boot. So using Dockerfile https://github.com/spring-guides/top-spring-boot-docker/tree/main/demo
Issue: Test failing
Caused by: java.lang.IllegalArgumentException at PropertyPlaceholderHelper.java:178
My application has a few environment variables dependency
jasypt.encryptor.password=${mjasypt.secret}
jasypt.encryptor.algorithm=${mjasypt.algo}
I am running build as below
docker build --build-arg DEPENDENCY=build/dependency -t ....
I tried 3 new env args into dockerfile
ARG CBS=a
ARG JSP=b
ARG JSA=c
and update entry point
ENTRYPOINT ["java","-noverify","-XX:TieredStopAtLevel=1","-cp","app:app/lib/*","-Dspring.main.lazy-initialization=true","-Dv1=${CBS}", "-Dv2=${JSP}", "-Dv3=${JSA}",...
and running command as, but didn't work
docker build --build-arg DEPENDENCY=build/dependency --build-arg CBS=.. --build-arg JSP=..1 --build-arg JSA=P..ES -t ...
Ive added RUN echo ${CBS} in the dockerfile and I can see the value that I passed from docker build (not a), but how can I know if that is inside ENTRY POINT too
CORRECTION: Dockerfile is multistage and also has
RUN --mount=type=cache,target=/root/.gradle ./gradlew clean build
How can I pass values to this command , as it runs tests