Create volumes

podman volume create postgis_data

Then run a container:

podman run --name spatialytics-postgis \
    -e PG_PASSWORD="$POSTGIS_PASSWORD" \
    -p 5432:5432 \
    -v postgis_data:/var/lib/postgresql/data \
    -d postgis/postgis

A bind mount is a mount that points to a directory in the host machine. The directory must already exist in the host system. Any changes made to the data in either location will be reflected in each other. To bind a folder:

podman run --name spatialytics-postgis \
    -e PG_PASSWORD="$POSTGIS_PASSWORD" \
    -p 5432:5432 \
    -v /path/to/your/postgis_data:/var/lib/postgresql/data \
    -d postgis/postgis

References

https://docs.podman.io/en/latest/markdown/podman-volume-create.1.html#examples https://suedbroecker.net/2024/01/20/cheatsheet-run-a-postgresql-container-with-podman-and-podman-compose/