![]() |
VOOZH | about |
Podman(Pod Manager) is the Daemonless, Open Source, Linux Native utility to create, manage, and run OCI(Open Container Initiative) containers and pods. Podman is a great Docker container alternative when you need greater security, UID separation via namespaces, and system integration. Podman is excellent for development, testing in CI/CD pipelines, and microservices, with very capable image management tools, and also systemd integration for service management.
Table of Content
Podman Volume is the set of subcommands that manage volumes. Podman creates and manages volumes. A volume is a section in the host filesystem attached to a running container, which means data from one place gets copied over to another place persists, and is shared between containers. It can be built manually with the podman volume command or during container construction.
You may use the following command to verify existing volumes before establishing new ones.
podman volume lsOutput:
Use the podman volume create command to start a new volume.
podman volume create mydataOutput:
When storing data which needs to remain intact between container restarts or re-creations, volumes come in useful.
podman volume lsOutput:
After creating a volume, you may check it to get information about it, including the mount point and options.
podman volume inspect mydataOutput:
In the next step, you will create a container and mount a host directory as a volume with Podman.
podman run -d --name webapp -v /var/www/html:/usr/share/nginx/html:Z nginxOutput:
Use the following command to verify volumes mounted in a running container
podman inspect --format "{{ .Mounts }}" <container_name>Output:
Then, you can stop the container and unmount a volume from it without taking the container or the volume out.
podman stop <container_name>Output:
Remove any volumes that are not in use by any containers.
podman volume pruneOutput:
People also Read
In conclusion, Working with containerized systems requires knowing how to manage storage using Podman volumes, particularly when handling persistent data. Podman volumes offer a straightforward yet effective method for storing data throughout the lifecycles of containers, making container management more reliable and adaptable.