Docker data and data volumes of container

What 1 Docker data and data volumes containers are?

  • Docker's philosophy is to run the application and environment of formation of packaging containers is running, it can run along with the container, but we hope that the data generated by persistence.
  • There might want to share data between containers.

 

  • Docker containers data generated by the docker commit if not generating a new image, such image data is saved as part of the pull-down, then when the container removed, naturally no data.
  • To be able to save the data in the docker, we need to use the data and data volumes container.

 

  • In short, somewhat similar to Redis of RDB and AOF.

 

2 Docker data and data volumes container can be doing?

  • Container basis endurance of.
  • Inherit and share data between containers.

 

Real data and data volumes of the container 3 Docker

3.1 Command Add

  • grammar:
Absolute path docker run -it -v host directory: the absolute path of the container within the directory image name

 

  • Example:

3.2 Check whether the data volume to mount successful

  • grammar:
docker inspect container vessel name or id

 

  • Example:

 

Guess you like

Origin www.cnblogs.com/xuweiweiwoaini/p/12131828.html