简体   繁体   中英

How can I automatically save the docker logs in the host

I have a web app that is running through docker container in a server where if I need to debug I use docker logs [OPTIONS] CONTAINER to find the problem.

I would like to have my container log on my host instead to connect on the docker to see it.

Please have a look into -v option of docker run command.

-v=[]: Create a bind mount with: [host-dir:]container-dir[:rw|ro].
If 'host-dir' is missing, then docker creates a new volume.
If neither 'rw' or 'ro' is specified then the volume is mounted
in read-write mode.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM