I’m using docker to deploy my java springboot application. But everytime I end up with an error
The dashboard for the docker container is showing the java home
I’m running the docker file from my InteliJ. Can anyone spot where I am doing wrong ?
Docker file
FROM openjdk:8u332-jdk-bullseye
RUN addgroup -system useradmin && adduser -system useradmin
COPY ibm-aspera-cli-3.9.1.1401.be67d47-linux-64-release.sh /tmp/ibm-aspera-cli-3.9.1.1401.be67d47-linux-64-release.sh
RUN chmod +x /tmp/ibm-aspera-cli-3.9.1.1401.be67d47-linux-64-release.sh
#install FFMPEG with global configuration.
RUN apt-get update && apt-get install -y ffmpeg
#Installing aspera into the system
RUN sh /tmp/ibm-aspera-cli-3.9.1.1401.be67d47-linux-64-release.sh
USER useradmin:useradmin
#Adding config file to aspera cli
COPY .aspera_cli_conf ~/.aspera/cli/bin
#Adding public key for aspera cli
COPY asperaclient.pem /home/useradmin/.aspera/cli/etc/
#Adding aspera cli into the environment path
ENV PATH="${-}:~/.aspera/cli/bin"
# The application's jar file
ARG JAR_FILE=*.jar
COPY ${JAR_FILE} /app.jar
COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
entrypoint.sh
#!/bin/sh
exec java -jar -Dspring.profiles.active=dev /app.jar
2
Answers
The error message tells you that
PATH
does not contain a binary calledjava
.Try adding
${JAVA_HOME}/bin
to thePATH
setting.You use a jdk image so you can override your entrypoint like this: