Docker runs all commands as root user. This is a huge security issue, and should be avoided.
To fix it, we can modify the Dockerfiles to a format like this:
# run here all commands related to system wide installations, such as pecl packages.
# setup non-root user
RUN useradd --create-home appuser
WORKDIR /home/appuser
USER appuser
# run the rest of the commands as usual but without root access
Docker runs all commands as root user. This is a huge security issue, and should be avoided.
To fix it, we can modify the Dockerfiles to a format like this: