Podman run fails silently?

I’m doing Rails development, and my preferred setup is using Toolbox for most of it so I can install stuff like memcached and imagemagick without layering (Toolbox is easier than creating a container for the whole app, and lets me run rails server and whatnot without creating container scripts), and using a podman container for postgresql. I’ve been doing this for a while now, and it works really well.

After a few weeks without work on this, I got a new computer now and a clean Silverblue install, and my old setup doesn’t work anymore. This is what I’ve been doing:

podman run --name app_db -p 5432:5432 -d docker.io/postgres:10-alpine
podman exec -it app_db bash -lc 'su - postgres -c "createuser --superuser root"'

Now the second command (which has always worked) fails with a Error: cannot exec into container that is not running: container state improper and podman ps doesn’t show the container at all.

However, podman stop app_db and podman restart app_db both act like nothing’s wrong. podman ps -a (a command I’ve never even tried until googling now) shows this:

CONTAINER ID  IMAGE                                             COMMAND               CREATED         STATUS                     PORTS                   NAMES
c8d1d8823122  docker.io/library/postgres:10-alpine              postgres              32 seconds ago  Exited (1) 32 seconds ago>5432/tcp  app_db

Any ideas? (I wanted to try here before filing a bug, since I’m relatively new to podman.)

Off the top of my head, I would note that Podman is using crun now instead of runc, plus Silverblue uses cgroupsV2 not cgroupsV1 which docker wants. If you look at the release notes here you will likely get a better explanation around that. You may need to migrate the container with podman.

The postgres image on the hub now requires a password to be set:

$ podman logs app_db
Error: Database is uninitialized and superuser password is not specified.
       You must specify POSTGRES_PASSWORD for the superuser. Use
       "-e POSTGRES_PASSWORD=password" to set it in "docker run".

       You may also use POSTGRES_HOST_AUTH_METHOD=trust to allow all connections
       without a password. This is *not* recommended. See PostgreSQL
       documentation about "trust":

So if you start it with a POSTGRES_PASSWORD variable it should work:

podman run --name app_db -p 5432:5432 -d -e POSTGRES_PASSWORD=password docker.io/postgres:10-alpine

Thank you, @basvdlei, it works! I feel so dumb now, didn’t occur to me to check if something had changed upstream with the docker image. I’ve never run it with environment variables since I only run postgresql containerized on local testing and I’ve never needed any kind of password. (I’m on the Ubuntu server apt package on the production server I’m managing.)