How does one use Apache in a Docker Container and write nothing to disk (all logs to STDIO / STDERR)?

前端 未结 6 902
不知归路
不知归路 2021-02-13 12:18

I\'m running Apache2 in a docker container and want to write nothing to the disk, writing logs to stdout and stderr. I\'ve seen a few different ways to do this (Supervisord and

6条回答
  •  囚心锁ツ
    2021-02-13 13:05

    I know it's an old question, but I had this need today.

    On an Alpine 3.6, the following instructions, in httpd.conf, are working:

    Errorlog /dev/stderr
    Transferlog /dev/stdout
    

    I add them to my container this way:

    FROM alpine:3.6
    RUN apk --update add apache2
    RUN sed -i -r 's@Errorlog .*@Errorlog /dev/stderr@i' /etc/apache2/httpd.conf
    RUN echo "Transferlog /dev/stdout" >> /etc/apache2/httpd.conf
    ...
    

提交回复
热议问题