Docker apache image, store logs in host?

Fujiao Liu

I use Docker to build an Apache image, and then use docker-compose to run it. I set up Apache access.log and error.log and want to store them outside of the container. currently, I use Volumes but it stores the data both in container and host.

docker-compose.yml

version: '2'

services:
  web:
    image: apache
    build: .
    container_name: my-image
    volumes:
        - "/var/log/my-app:/var/log/apache2"
    restart: always
    ports:
      - "8000:80"

My question is how to only store apache log data in a host, and It woule be better if there is a way to stream apache log data to stdout so that I don't need to store in the host.

Thanks in advance!

VonC

Volumes but it stores the data both in container and host.

Not really, it should only store data in the host (and makes it visible in the container through a bind mount)

if there is a way to stream apache log data to stdout

Possible yes, through configuration, but that would not be persistent.

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

Apache logs deleted

분류에서Dev

Apache virtual host configuration error

분류에서Dev

Accessing Docker Services from Host

분류에서Dev

unable to display external host image

분류에서Dev

How does Apache resolves the requested virtual host?

분류에서Dev

Apache Virtual Host Mix IP and domain names

분류에서Dev

How to store image from cam?

분류에서Dev

How can I format the way Apache logs an error?

분류에서Dev

Apache2 Logs - Single user agent shows as an escaped string

분류에서Dev

Getting wordpress docker to run on local host

분류에서Dev

Mounting a NFS Directory into Host Volume that is shared with Docker

분류에서Dev

Docker on Linux VM using host OS RAM

분류에서Dev

Docker image with OpenCV and FFPMEG

분류에서Dev

Apache Mesos의 Docker Containerizer

분류에서Dev

How to pick host name in Per service logs in WSO2 ESB

분류에서Dev

How to access apache server running in virtualbox from host?

분류에서Dev

Apache set virtual host access 403 access forbidden, why?

분류에서Dev

Apache web server - FTP host connection issue in LAN

분류에서Dev

store image name into database from directory

분류에서Dev

image slideshow with dispatcher timer in windows store apps

분류에서Dev

boot2docker Cannot connect to the Docker daemon. Is the docker daemon running on this host?

분류에서Dev

How to find volume files from host while inside docker container?

분류에서Dev

buildroot 배포판을 docker * host *로 사용

분류에서Dev

docker 컨테이너의 systemd / journald 로그를 "docker logs"로 가져옵니다.

분류에서Dev

Filtering out image/css/js requests from access logs in tomcat 7

분류에서Dev

Azure Docker : linuxFxVersion 대 DOCKER_CUSTOM_IMAGE_NAME

분류에서Dev

Ansible docker_image로 Docker 빌드

분류에서Dev

Docker Image - Error with apt get update -y

분류에서Dev

Unable to deploy docker image to GKE using Jenkins

Related 관련 기사

  1. 1

    Apache logs deleted

  2. 2

    Apache virtual host configuration error

  3. 3

    Accessing Docker Services from Host

  4. 4

    unable to display external host image

  5. 5

    How does Apache resolves the requested virtual host?

  6. 6

    Apache Virtual Host Mix IP and domain names

  7. 7

    How to store image from cam?

  8. 8

    How can I format the way Apache logs an error?

  9. 9

    Apache2 Logs - Single user agent shows as an escaped string

  10. 10

    Getting wordpress docker to run on local host

  11. 11

    Mounting a NFS Directory into Host Volume that is shared with Docker

  12. 12

    Docker on Linux VM using host OS RAM

  13. 13

    Docker image with OpenCV and FFPMEG

  14. 14

    Apache Mesos의 Docker Containerizer

  15. 15

    How to pick host name in Per service logs in WSO2 ESB

  16. 16

    How to access apache server running in virtualbox from host?

  17. 17

    Apache set virtual host access 403 access forbidden, why?

  18. 18

    Apache web server - FTP host connection issue in LAN

  19. 19

    store image name into database from directory

  20. 20

    image slideshow with dispatcher timer in windows store apps

  21. 21

    boot2docker Cannot connect to the Docker daemon. Is the docker daemon running on this host?

  22. 22

    How to find volume files from host while inside docker container?

  23. 23

    buildroot 배포판을 docker * host *로 사용

  24. 24

    docker 컨테이너의 systemd / journald 로그를 "docker logs"로 가져옵니다.

  25. 25

    Filtering out image/css/js requests from access logs in tomcat 7

  26. 26

    Azure Docker : linuxFxVersion 대 DOCKER_CUSTOM_IMAGE_NAME

  27. 27

    Ansible docker_image로 Docker 빌드

  28. 28

    Docker Image - Error with apt get update -y

  29. 29

    Unable to deploy docker image to GKE using Jenkins

뜨겁다태그

보관