Podman : Use External Storage2020/11/06 |
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 78G 3.4G 75G 5% / tmpfs tmpfs 64M 0 64M 0% /dev /dev/mapper/fedora_fedora-root xfs 78G 3.4G 75G 5% /mnt shm tmpfs 63M 0 63M 0% /dev/shm tmpfs tmpfs 2.4G 1.2M 2.4G 1% /etc/hosts[root@dlp ~]# cat /var/lib/containers/disk01/testfile.txt persistent storage |
Sponsored Link |