Setting the container volume from the host?

im configures the mysql container as follows:

docker run -v / srv / information-db: / var / lib / mysql tutum / mysql / bin / bash -c "/ usr / bin / mysql_install_db"

now it works when nothing is mounted on the host / srv, but when I mount my disk, it seems like dockers are being written to the base file system (/), for example:

/]# ls -l /srv
total 0
/]# mount /dev/xvdc1 /srv
/]# mount
...
/dev/xvdc1 on /srv type ext4 (rw,relatime,seclabel,data=ordered)

/]# docker run -v /srv/information-db:/var/lib/mysql tutum/mysql /bin/bash -c "/usr/bin/mysql_install_db"

/]# ls -l /srv
total 16
drwx------. 2 root root 16384 Apr 22 18:05 lost+found
/]# umount /dev/xvdc1
/]# ls -l /srv
total 4
drwxr-xr-x. 4 102 root 4096 Apr 22 18:24 information-db

Has anyone seen this behavior / had a solution? Greetings

+4
source share
1 answer

- . stat -c %i , ( inode dirs). , - , .

+1

Source: https://habr.com/ru/post/1584084/


All Articles