'shell script in podman conatinerfile

I have a very simple Container file to create an image

FROM registry.access.redhat.com/ubi8/ubi:latest

USER root

RUN mkdir /u01/

RUN useradd -ms /bin/bash ofm

RUN echo 'ofm:passwdofm' | chpasswd

RUN chown -R ofm:ofm /u01

USER ofm

RUN mkdir -p /u01/downloads /u01/app

# copy sadeLogger dir from host system to container 
COPY --chown=ofm:ofm  ./sadeLogger /u01/downloads/

# install jdk in the container
RUN /u01/downloads/installOracleJdk.sh /u01/downloads/jdk-8u321-linux-x64.tar.gz

# install my little app in the container
RUN /u01/downloads/sadeLogAgentInstall.sh /u01/downloads/SadeLogAgent.tar

# run my little app in the container 
RUN /u01/app/SadeLogAgent/gosadelogagent.sh &

When I create container from this image, everything works except last step. For some reason it cannot run my app. If I start container in interactive mode I can get into the container and start my application and it works fine. I want my application to run in when I start container in detached mode. Can some help with this? What could be the posible reason that last step does not work?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source