skip to Main Content

I’m using docker to deploy my java springboot application. But everytime I end up with an error

enter image description here

The dashboard for the docker container is showing the java home

enter image description here

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


  1. The error message tells you that PATH does not contain a binary called java.

    Try adding ${JAVA_HOME}/bin to the PATH setting.

    Login or Signup to reply.
  2. You use a jdk image so you can override your entrypoint like this:

    ENTRYPOINT ["java", "-jar", "-Dspring.profiles.active=dev", "/app.jar"]
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search