How can i persist my logs/data to local filesystem in docker

Sohan

have an application running inside docker container. the application writes log messages into local log files. how can i make the log file persistent in case the docker container stops or crashes?

Since the container are run time entity ,when i stop the image my logs/data is gone.

Thanks, Sohan

seanmcl

You can do this using docker volumes:

https://docs.docker.com/userguide/dockervolumes/

For example:

docker run -v /var/log/docker:/var/log your-image

will mount the log directory on your local file system. You can also get much fancier, creating containers just for data. It's all explained in the above link.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How can I expose my tomcat server outside of my docker container running on my local machine?

From Dev

how can I get my php array data to persist?

From Dev

how can I use volume to persist my mongodata?

From Dev

How can I inspect a docker container's filesystem that cannot run?

From Dev

How can I persist resource data when my route changes in AngularJS?

From Dev

To make my code work I had to alter some core functionality of cheerio, how can I persist it in my module?

From Dev

How can I make xrandr changes persist?

From Dev

How can I save my RSA KEY in my Docker Machine?

From Dev

How can I specify a path and filename for my files with meteor and collectionfs filesystem

From Dev

How can I zero the unused blocks on my filesystem in order to minimize the compressed disk image size?

From Dev

How can I view my virtualbox guest unix filesystem from the host windows file/text editor?

From Dev

How can I expand my ext4 filesystem after transfering via dd

From Java

How can I specify a local gem in my Gemfile?

From Dev

How can I confirm my name on a local network?

From Dev

How can I add a local library into my Leinigen project?

From Dev

How can I extract the value of my current local time offset?

From Dev

How can I build my local git repo on external server?

From Dev

How can I use local .deb files in my pbuilder builds?

From Dev

How can I add ~/.local/bin to my PATH?

From Dev

How can I find my local mail spool?

From Dev

How can I play a local video in my IPython notebook?

From Dev

How can I use local .deb files in my pbuilder builds?

From Dev

How can I confirm my name on a local network?

From Dev

How can I create a local function in my bashrc?

From Dev

How can I get the address of my local machine?

From Dev

How can I control my local network internet surfing?

From Dev

How can I use my local time as the only reference of `ntpd`?

From Dev

How can I copy a jpg to my local over an ssh

From Dev

How can i remove the hotmail email was linked to my local administrator?

Related Related

  1. 1

    How can I expose my tomcat server outside of my docker container running on my local machine?

  2. 2

    how can I get my php array data to persist?

  3. 3

    how can I use volume to persist my mongodata?

  4. 4

    How can I inspect a docker container's filesystem that cannot run?

  5. 5

    How can I persist resource data when my route changes in AngularJS?

  6. 6

    To make my code work I had to alter some core functionality of cheerio, how can I persist it in my module?

  7. 7

    How can I make xrandr changes persist?

  8. 8

    How can I save my RSA KEY in my Docker Machine?

  9. 9

    How can I specify a path and filename for my files with meteor and collectionfs filesystem

  10. 10

    How can I zero the unused blocks on my filesystem in order to minimize the compressed disk image size?

  11. 11

    How can I view my virtualbox guest unix filesystem from the host windows file/text editor?

  12. 12

    How can I expand my ext4 filesystem after transfering via dd

  13. 13

    How can I specify a local gem in my Gemfile?

  14. 14

    How can I confirm my name on a local network?

  15. 15

    How can I add a local library into my Leinigen project?

  16. 16

    How can I extract the value of my current local time offset?

  17. 17

    How can I build my local git repo on external server?

  18. 18

    How can I use local .deb files in my pbuilder builds?

  19. 19

    How can I add ~/.local/bin to my PATH?

  20. 20

    How can I find my local mail spool?

  21. 21

    How can I play a local video in my IPython notebook?

  22. 22

    How can I use local .deb files in my pbuilder builds?

  23. 23

    How can I confirm my name on a local network?

  24. 24

    How can I create a local function in my bashrc?

  25. 25

    How can I get the address of my local machine?

  26. 26

    How can I control my local network internet surfing?

  27. 27

    How can I use my local time as the only reference of `ntpd`?

  28. 28

    How can I copy a jpg to my local over an ssh

  29. 29

    How can i remove the hotmail email was linked to my local administrator?

HotTag

Archive