V
V
v_cirill2014-11-21 18:30:26
Virtualization
v_cirill, 2014-11-21 18:30:26

Docker, using volume, migrating containers between physical hosts?

Good afternoon.
What is the purpose of using volume in dockerfile and how to migrate containers using volume between physical hosts?
For example, mysql dockerfile
VOLUME ["/var/lib/mysql"]
The documentation says the following
1) Data volumes can be shared and reused between containers
2) Changes to a data volume are made directly
3) Changes to a data volume will not be included when you update an image
4) Volumes persist until no containers use them
I don't understand point 3.
I launched mysql, created a database, made a commit to the image and the data from the directory specified in volume did not get into the image?
And how to migrate volume containers between hosts?
via docker save or export ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
v_cirill, 2014-11-22
@v_cirill

Do I understand the situation with volume correctly? I
have an image lalal / mysql from the lalal maintainer
, when building which VOLUME was not specified.
Launched two containers based on this image - host1 and host2
inside the container mysql work and there are several databases in / var / lib / mysql
It turned out image + two layers for containers.
And then I understand that it would be nice to update the mysql version and I see that lalal has updated image
I stop host1 host2 containers, update image, run host1 and host2 and see that the /var/lib/mysql directories have been replaced with directories from the updated image, because " Fundamentals" for containers has been updated?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question