0

I am new to docker and openshift, I deployed my application on openshift using docker image. The image is as follows:

FROM quay.cloud.repository
MAINTAINER DEVELOPER

LABEL description="ABC application image" \
      name="01-abc/abc" \
      version="1.0"

ARG APP_HOME=/opt/app
ARG PORT=8080

ENV JAR=app.jar \
    SPRING_PROFILES_ACTIVE=default \
    JAVA_OPTS=""

RUN mkdir $APP_HOME 

ADD $JAR $APP_HOME/

WORKDIR $APP_HOME
EXPOSE $PORT
ENTRYPOINT java $JAVA_OPTS -Dspring.profiles.active=$SPRING_PROFILES_ACTIVE -jar $JAR

but in pod terminal I get Unable to access jarfile app.jar. What could be the issue here? Let me know if I need to submit any other info

  • This seems like it should work. You might try removing all of the `ARG` and `ENV` settings, so it's clearer what you're doing. If you change `ENTRYPOINT` to `CMD` you can also `docker run --rm -it your-image sh` to get an interactive debugging shell. (That `ENTRYPOINT` construction ignores the `CMD` entirely so there's no real downside to switching to `CMD`.) – David Maze Dec 05 '21 at 20:51
  • @DavidMaze could this be related to deploymentConfig on openshift. Pods does not get created and in pod terminal I get this message Unable to access jarfile app.jar – Syed Iftekharuddin Dec 05 '21 at 21:24
  • @DavidMaze could you PLEASE have a look at this issue, maybe it is related https://stackoverflow.com/questions/70109707/openshift-missing-permissions-to-create-a-file?noredirect=1#comment123962432_70109707 – Syed Iftekharuddin Dec 05 '21 at 21:45

1 Answers1

0

I noticed that whenever I add

securityContext:
     supplementalGroups: [5555]

There is no error and pod are created and runs correctly. I used this this from the openshift documentation.