![]() |
VOOZH | about |
In general, Docker containers are ephemeral, running just as long as it takes for the command issued in the container to complete. By default, any data created inside the container is only available from within the container and only while the container is running.
Docker volumes can be used to share files between a host system and the Docker container. For example, letβs say you wanted to use the official Docker Nginx image and keep a permanent copy of Nginxβs log files to analyze later. By default, the nginx Docker image will log to the /var/log/nginx directory inside the Docker Nginx container. Normally itβs not reachable from the host filesystem.
In this tutorial, weβll explore how to make data from inside the container accessible on the host machine.
Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Excellent posts on Docker, Melissa. The way you break each command down in detail and explain the flags you use makes it easy to understand and learn.
It doesnβt work if the host is on the digitalocean and the local directory is on my laptop.
If I ran the container without -v do I need to recreate the container after if I want to add the share?
This comment has been deleted
Excellent Post. Good post if we have any doubt about how docker is running internally. Keep it up.
Regards Vipul
Quick question tutorials. Do you have videos as well. sometimes, its faster to understand. I love digital ocean tutorials. Very well written with nice fonts, great content.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Scale up as you grow β whether you're running one virtual machine or ten thousand.
From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.