From the course: Red Hat Certified System Administrator (EX200) Cert Prep: 2 File Access, Storage, and Security

Unlock the full course today

Join today to access over 23,300 courses taught by industry experts.

Attach persistent storage to a container

Attach persistent storage to a container

- [Instructor] Although it is possible to copy data into a container image and make it persistent, this also makes the container larger. Another alternative is to create a Podman volume and attach it to the container. These volumes will persist even across container deletions. Volumes can be used to share data among multiple containers, and since a volume is just a folder on the host machine, it makes it easy to share data with the host as well. And as such, makes it easier to back up data or migrate to another host. To attach a volume to a container, we have to create it with Podman first. Type into a terminal podman volume create hostvol. I named it hostvol to remind me that it's a volume I created on the host. Now inspect it using Podman. Type in podman volume inspect hostvol, and hit enter. This will show the volume's name which we defined, and the mountpoint in .local/share/container/storage/volumes. Copy the…

Contents