Docker management application data

Mount Docker host data to the container method

Docker provides three different ways to mount data from the host to the container:

  • volumes: Docker manages part of the host's file system (/var/lib/docker/volumes)
  • bind mounts: can be stored anywhere on the host system
  • tmpfs: The mount is stored in the memory of the host system, and will not be written to the host's file system
    Insert picture description here

Data volume form (volume)

Insert picture description here

The data volume can share related data in different containers.
If the data volume is not specified in the creation of the container, docker will create an anonymous volume on the move.

Bind Mount

Insert picture description hereUnlike volume, data volume needs to be created and managed, but binding is to bind container data to a file directory that already exists on the host.

Guess you like

Origin blog.csdn.net/Mwyldnje2003/article/details/105917853