[docker] apacheのimageを動かす

docker-compose.yml

version: "3"
services:
  web:
    image: httpd
    volumes:
      - .:/usr/local/apache2/htdocs/
    ports:
      - "8080:80"

index.html

<h1>hello</h1>

http://192.168.56.10:8080/

$ sudo docker-compose logs
Attaching to test_web_1
web_1 | AH00558: httpd: Could not reliably determine the server’s fully qualified domain name, using 172.21.0.2. Set the ‘ServerName’ directive globally to suppress this message
web_1 | AH00558: httpd: Could not reliably determine the server’s fully qualified domain name, using 172.21.0.2. Set the ‘ServerName’ directive globally to suppress this message
web_1 | [Fri Mar 11 04:05:16.651353 2022] [mpm_event:notice] [pid 1:tid 140458656537920] AH00489: Apache/2.4.52 (Unix) configured — resuming normal operations
web_1 | [Fri Mar 11 04:05:16.651484 2022] [core:notice] [pid 1:tid 140458656537920] AH00094: Command line: ‘httpd -D FOREGROUND’
web_1 | 192.168.56.1 – – [11/Mar/2022:04:05:28 +0000] “GET / HTTP/1.1” 200 14
web_1 | 192.168.56.1 – – [11/Mar/2022:04:06:19 +0000] “-” 408 –
※アクセスログとエラーログを分けることができない

Dockerは仕組み上、標準出力とエラーログ でしか分けられない