How to mount directory with docker logs to docker container

651 Views Asked by At

I am using Docker for Windows on Windows 10 with WSL

I want to collect docker logs using Fluentd

I figured out that docker logs on my machine store here \\wsl$\docker-desktop-data\version-pack-data\community\docker\containers

I need to bind mount this folder to fluend container

Any ideas for that?

1

There are 1 best solutions below

0
o_nvk On BEST ANSWER

To mount docker log storage to container could be used bind mount the same as on Linux

volumes:
  - /var/lib/docker/containers:/fluentd/log/containers

Note: fluend should use the root user, indeed it will get permission deny on /fluentd/log/containers directory