Tutorial #6 | What is Docker volume and How to mount a host directory volume? | Engineer

preview_player
Показать описание
In this video, I have explained how to manage data within a Docker container.

Docker volumes are the preferred way to persist data in docker container and services. This helps us to manage data within our docker containers. It separates out the container’s lifecycle from the data.

Two ways to manage your data within docker is:

1) Docker volumes
2) Docker volume containers

Few commands from today's video:

docker run -it -v /data --name container1 ubuntu //Mounting a data volume
docker ps -a //should see our container
docker inspect container1 // it shows info about docker container
docker restart container1 //restart the container
docker attach container1 //open container in interactive mode

docker run -it --name container1 -v /Users:/datavolume ubuntu //Mounting a host directory as a data volume
docker run -it --volumes-from container1 --name container2 ubuntu //create docker volume container

======================
Important playlists
======================

======================
You can follow me on:
======================

=============================================================
|| Subscribe and hit the bell button to get latest content ||
=============================================================

#docker #dockervolume #whatisdockervolume #mountinghostdirectory
Рекомендации по теме
Комментарии
Автор

Excellent example, well done. Exactly what I needed.

ram