I am extending base httpd2.4 image (https://github.com/docker-library/httpd/blob/b814ed0f036c6084d67ce5d996b4648a9bda6275/2.4/Dockerfile) in my project.
Installation/workdir for apache2 is getting created inside as /usr/local/apache2
I want to move this location to e;g /myappusers/usr/local/apache2. Is this a valid approach?
Part of security implementation we have to run all containers as non-root and we are trying to move all dirs/files under the same user.
We can also give R/W permission to the same user on the existing WORKDIR but would like to have a consistent approach
This is my current Dockefile
RUN apt-get update
&& apt-get install -y wget
&& rm -rf /var/lib/apt/lists/*
COPY httpd.conf /usr/local/apache2/conf/httpd.conf
COPY httpd-ssl.conf /usr/local/apache2/conf/extra/httpd-ssl.conf
Trying something like this:
ADD /usr/local/apache2 /$MYAPP_USER
RUN chown -R $MYAPP_USER /$MYAPP_USER