Skip to content

Instantly share code, notes, and snippets.

@joltcan
Last active March 29, 2017 07:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joltcan/272ee3f72e6f3e526829050b73230d1e to your computer and use it in GitHub Desktop.
Save joltcan/272ee3f72e6f3e526829050b73230d1e to your computer and use it in GitHub Desktop.
Run apache as user in docker
RUN chown apache /run/httpd
RUN sed -i 's/Listen 80/Listen 8080/' /etc/httpd/conf/httpd.conf
RUN sed -ri \
-e 's!^(\s*CustomLog)\s+\S+!\1 /proc/self/fd/1!g' \
-e 's!^(\s*ErrorLog)\s+\S+!\1 /proc/self/fd/2!g' \
/etc/httpd/conf/httpd.conf
USER apache
CMD ["/usr/sbin/httpd", "-DFOREGROUND"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment