Dear all,
I am using Ubuntu 18.04 as the base image and installed necessary packages for the same.
a. I want to run apache2 service from the root and I will move to user for starting the contianer. For this, I have used the command ,
USER root
RUN service apache2 start
CMD apachectl -D FOREGROUND
USER user
But when I move to user later on, this apache2 service status stays not connected. How to stay it connected throughout in the user too.?
b. I also have .sh file which need to be run
The command used for .sh run file is:
USER root
WORKDIR /home/data/pvw/bin
RUN chmod +x start.sh
USER user
CMD [ "sh", "-c", "./start.sh;bash"] #sleep infinity
c. Finally, how to run both sh file along with apache2 service from the same dockerfile that works on user? (The sh file works on user, but not the apache2 service?)
d. I am new to docker, so if the framing of question is not correct, please correct me.
Regards,
Sunag R A.