Podman doesn't store installed packages

I am running podman image docker.io/cabelo/opensuse-leap-15.2 as a normal user. When I install packages, exit and connect to the image the packages go missing. I want the packages to remain in the system, please help.

Overview

Thu Dec 10 00:42:22 root@localhost /home/flux] 
# cat /etc/sub[gu]id
flux:2000000:65536
flux:2000000:65536

[Thu Dec 10 01:05:33 flux@localhost /tmp] 
# grep -v "#" ~/.config/containers/storage.conf | grep .
[storage]
driver = ""
runroot = "/home/flux/.local/run/containers/storage"
graphroot = "/home/flux/.containers/storage"
[storage.options]
additionalimagestores = 
]
size = ""
mount_program = "/usr/bin/fuse-overlayfs"
ostree_repo = ""
 skip_mount_home = "false"
[storage.options.thinpool]
 fs="xfs"
 min_free_space = "10%"

Container -

[Thu Dec 10 00:53:05 flux@localhost /tmp] 
# podman pull docker.io/cabelo/opensuse-leap-15.2
Trying to pull docker.io/cabelo/opensuse-leap-15.2...
Getting image source signatures
Copying blob 412fc301872e done  
Copying config 9a3f2ddcda done  
Writing manifest to image destination
Storing signatures
9a3f2ddcdab14d2ca4e00c25b654162f990f61f66732d83ead987cd0ba70d05c

[Thu Dec 10 00:54:13 flux@localhost /tmp] 
# podman images
REPOSITORY                           TAG     IMAGE ID      CREATED       SIZE
docker.io/cabelo/opensuse-leap-15.2  latest  9a3f2ddcdab1  2 months ago  107 MB

[Thu Dec 10 00:54:17 flux@localhost /tmp] 
# podman run -dit 9a3f2ddcdab1 /bin/bash
b030061d2f0bf3e78d8fd3a6a7561767f74fdb833bc302a96f22f52355ee5be4

[Thu Dec 10 00:54:42 flux@localhost /tmp] 
# podman run -it 9a3f2ddcdab1 /bin/bash 
02be9c63ca38:/ # zypper ref
warning: Found NDB Packages.db database while attempting bdb backend: using ndb backend.
warning: Found NDB Packages.db database while attempting bdb backend: using ndb backend.
warning: Found NDB Packages.db database while attempting bdb backend: using ndb backend.
Retrieving repository 'OSS' metadata .......................................................................................................................................................................[done]
Building repository 'OSS' cache ............................................................................................................................................................................[done]
All repositories have been refreshed.
02be9c63ca38:/ # zypper up 
warning: Found NDB Packages.db database while attempting bdb backend: using ndb backend.
warning: Found NDB Packages.db database while attempting bdb backend: using ndb backend.
warning: Found NDB Packages.db database while attempting bdb backend: using ndb backend.
Loading repository data...
Reading installed packages...
warning: Found NDB Packages.db database while attempting bdb backend: using ndb backend.

Nothing to do.
02be9c63ca38:/ # zypper in nano
warning: Found NDB Packages.db database while attempting bdb backend: using ndb backend.
warning: Found NDB Packages.db database while attempting bdb backend: using ndb backend.
warning: Found NDB Packages.db database while attempting bdb backend: using ndb backend.
Loading repository data...
Reading installed packages...
warning: Found NDB Packages.db database while attempting bdb backend: using ndb backend.
Resolving package dependencies...

The following NEW package is going to be installed:
  nano

1 new package to install.
Overall download size: 496.6 KiB. Already cached: 0 B. After the operation, additional 1.5 MiB will be used.
Continue? [y/n/v/...? shows all options] (y): 
Retrieving package nano-4.9.2-lp152.1.2.x86_64                                                                                                                               (1/1), 496.6 KiB (  1.5 MiB unpacked)
Retrieving: nano-4.9.2-lp152.1.2.x86_64.rpm ..................................................................................................................................................[done (117.5 KiB/s)]

Checking for file conflicts: ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\]warning: Found NDB Packages.db database while attempting bdb backend: using ndb backend.
Checking for file conflicts: ...............................................................................................................................................................................[done]
(1/1) Installing: nano-4.9.2-lp152.1.2.x86_64 ..............................................................................................................................................................[done]
Additional rpm output:
warning: Found NDB Packages.db database while attempting bdb backend: using ndb backend.
warning: Found NDB Packages.db database while attempting bdb backend: using ndb backend.


warning: Found NDB Packages.db database while attempting bdb backend: using ndb backend.
02be9c63ca38:/ # exit
exit

[Thu Dec 10 00:57:13 flux@localhost /tmp] 
# podman run -it 9a3f2ddcdab1 /bin/bash
2710f14f441f:/ # which nano
bash: which: command not found
2710f14f441f:/ # zypper in which
warning: Found NDB Packages.db database while attempting bdb backend: using ndb backend.
warning: Found NDB Packages.db database while attempting bdb backend: using ndb backend.
warning: Found NDB Packages.db database while attempting bdb backend: using ndb backend.
Retrieving repository 'OSS' metadata .......................................................................................................................................................................[done]
Building repository 'OSS' cache ............................................................................................................................................................................[done]
Loading repository data...
Reading installed packages...
warning: Found NDB Packages.db database while attempting bdb backend: using ndb backend.
Resolving package dependencies...

The following NEW package is going to be installed:
  which

1 new package to install.
Overall download size: 38.8 KiB. Already cached: 0 B. After the operation, additional 75.1 KiB will be used.
Continue? [y/n/v/...? shows all options] (y): 
Retrieving package which-2.21-lp152.4.114.x86_64                                                                                                                             (1/1),  38.8 KiB ( 75.1 KiB unpacked)
Retrieving: which-2.21-lp152.4.114.x86_64.rpm ..................................................................................................................................................[done (5.0 KiB/s)]

Checking for file conflicts: ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------/]warning: Found NDB Packages.db database while attempting bdb backend: using ndb backend.
Checking for file conflicts: ...............................................................................................................................................................................[done]
(1/1) Installing: which-2.21-lp152.4.114.x86_64 ............................................................................................................................................................[done]
Additional rpm output:
warning: Found NDB Packages.db database while attempting bdb backend: using ndb backend.
warning: Found NDB Packages.db database while attempting bdb backend: using ndb backend.


warning: Found NDB Packages.db database while attempting bdb backend: using ndb backend.
2710f14f441f:/ # which nano
which: no nano in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin)

You are running different containers as indicated by the prompt, one you just run and detached immediately, one where you installed stuff, and another one where you try to find the stuff you installed in the second one. You will want to run the image once to create a container and then exec into that container and do stuff, and finally save the container to a new image in order to run that later.

Watch a few tutorials on YT. I suggest searching for docker ones as podman is still fairly new. The concepts of image vs container are the same and the command syntax too. You will want to check on the difference of run vs exec and possibly the save commands.

I don’t run Podman,
But, I think anyone who has run Docker on openSUSE can read what you’ve posted… Which is incomplete so I’m going to do a little assuming.

First,
I’ll take Podman at their word, that reading Podman is and what Podman does is not that different than regular Docker, it looks like Podman does a little bit of basic management and orchestration, so I should be able to assume that basic functionality and procedures are all Docker.

You only posted what you did within your downloaded openSUSE container and nothing more.
You should understand that a basic Docker concept is that by using a Dockerfile the container is typically re-built each time it’s newly launched but I suspect that Podmn gives you an alternate means of saving your customized container which is more like how we more often use our computer devices.
If you simply exited without saving/suspending your container to an archive, you’ll have lost all your changes.

Podman suggests that brand new Users with no experience start with their Introduction page

http://docs.podman.io/en/latest/Introduction.html

Podman then says that when you have grasped what is at the above link then you can go on to the following. Those who have Docker experience can jump directly to the following which list Podman commands and suggest some tutorials

http://docs.podman.io/en/latest/Commands.html
http://docs.podman.io/en/latest/Tutorials.html

If you want some quick and easy introduction to Docker, I recommend the following which is pretty old now but should still work. Based on original documentation at the time, modified to utilize openSUSE commands. Shouldn’t take long to run through and introduces the User to some basic procedures. Not Podman, but might make Podman easier to learn.

https://en.opensuse.org/User:Tsu2/Docker_Install
https://en.opensuse.org/User:Tsu2/docker-build-tutorial-1

TSU

Thanks for the tip. I am using podman for the first time, have largely used lxd & some docker previously. It is very different. I had only one container, now deleted everything. I will start over and see.

Thanks for sharing invaluable resources. I switched to podman because docker doesn’t set the auid bit in the audit and I have too much time on my hands at the moment. I tried podman save > leap.tar <image_id> before exiting the container post changes and later issued podman load -i leap.tar but again the changes were lost. I will experiment some more and report back.

I figured it out, after exit I need to start the correct instance by executing podman start -ai <container_id>. Now the system is persistent.