Manage Containers with Podman

Haluk KARAKAYA
1 min readJan 25, 2021

I want to share some podman command options I think they are useful.

For saving containers as a tar file and import in another machine :

$ podman save -o FILE_NAME IMAGE_NAME:TAG 
$ podman save -o httpd.tar quay.io/halukkarakaya/httpd:2.4
$ podman load -i FILE_NAME
$ podman load -i mysql.tar

For deleting all images (Maybe you can use this with a cron job for routine clean up on your server:

$ podman rmi -a

For manuplating a container according to your needs :

$ podman commit yourcontainer REPOSITORY[:PORT]/IMAGE_NAME:TAG
$ podman commit right_freo quay.io/halukkarakaya/customcontainer:2.4

For pushing your images to a registry:

$ podman push quay.io/halukkarakaya/customcontainer:2.4

You can use the diff option to control the work and change in the container:

$ podman diff customcontainer
C /run
C /run/custom
A /run/custom/custom.pid
A /run/secrets

The diff subcommand tags any added file with an A, any changed ones with a C, and any deleted file with a D.

--

--