Podman : Use External Storage2019/11/19 |
When Container is removed, data in it are also lost, so it's necessary to use external storage on Container if you need.
|
|
[1] | It's possible to mount a directory on Container Host into Containers as a external storage. |
# run container with mounting the directory on /mnt # if SELinux is [Enforcing], needs [--privileged] option like follows [root@dlp ~]# podman run --privileged -it -v /var/lib/containers/disk01:/mnt fedora /bin/bash
df -hT Filesystem Type Size Used Avail Use% Mounted on overlay overlay 73G 4.0G 70G 6% / tmpfs tmpfs 64M 0 64M 0% /dev /dev/mapper/fedora-root xfs 73G 4.0G 70G 6% /mnt shm tmpfs 63M 0 63M 0% /dev/shm tmpfs tmpfs 5.9G 1.2M 5.9G 1% /etc/hosts[root@dlp ~]# cat /var/lib/containers/disk01/testfile.txt persistent storage |
Sponsored Link |