5, docker data volume container

Docker container volume data
is what
a word: somewhat similar to our Redis inside rdb and aof files
can be doing
persistence container
between container inherit + share data
volume data
is added into the container
direct command add
command
docker run -it -v / host absolute path to the directory: / directory mirrors the container name
to see if the data volumes to mount a successful
data sharing between the host and the container
after container stop exit, after the host whether to modify the data synchronization
command (with permission)
Docker RUN -it -v / host absolute path to the directory: / container directory: RO mirror name
DockerFile add
new mydocker folder and into the root directory
may be used in Dockerfile vOLUME command to add one or more data volumes to the mirror
file construct
build the generated image
to obtain a new image zzyy / CentOS
RUN container
by the above steps, the container volume directory address corresponding to a host already knows which directory address? ?
The default address corresponding to the host
Memo
data volume container
is what
the overall presentation
more step in the new image zzyy / centos as a template and run the container dc01 / dc02 / dc03
they already have a container volumes
/ dataVolumeContainer1
/ dataVolumeContainer2
between container transfer share (--volumes-from)
first to start a dc01 parent container
in dataVolumeContainer2 New in
succession dc02 / dc03 from dc01
--volumes-from
command
dc02 / dc03 content in their respective new dataVolumeContainer2
back dc01 can see each added 02/03 can share the
delete dc01, after dc02 dc03 possibility of modifying access
after removing dc02 dc03 possibility of access to
further
new inheritance dc03 dc04 dc03 then delete
conclusion: the transmission of information between the container configuration, data volume of the life cycle continues until no container to use it so far

Guess you like

Origin www.cnblogs.com/venicid/p/11879403.html
Recommended