<p>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 stdout/stderr, Apache access log to stdout) but these seem like hacks. Is there no way to do this by default?</p>

<p>To be clear, I do not want to tail the log, since that will result in things being written to the disk in the container.</p>

<p>The "official" version checked into Docker Hub (<a href="https://hub.docker.com/_/httpd/" rel="noreferrer">https://hub.docker.com/_/httpd/</a>) still write to disk.</p>

<p>Also, what do I need to do to stop Apache from failing when it tries to roll the logs?</p>

<p>One other thing - ideally, I'd really like to do this without another add-on. nginx can do this trivially.</p>

<p>I'm not positive that this won't mess with httpd's logging at all (e.g. if it tries to seek within the file), but you can set up symlinks from the log paths to /dev/stdout and /dev/stderr, like so:</p>

<pre><code>ln -sf /dev/stdout /path/to/access.log
ln -sf /dev/stderr /path/to/error.log
</code></pre>

<p>The entry command to the vanilla httpd container from Docker Hub could be made to be something like</p>

<pre><code>ln -sf /dev/stdout /path/to/access.log &amp;&amp; ln -sf /dev/stderr /path/to/error.log &amp;&amp; /path/to/httpd
</code></pre>
