postgresqlrepositorypodmanpodman-compose

Error message when creating a postgresql container using Podman


I am unable to create a postgress container using Podman in Ubuntu from why Windows terminal and I don't know why.

this is my command :

podman pod create --name postgress-container -p 8080:8080

this is the message I get:

"Error: repository name must have at least one component"


Solution

  • You are probably missing the image name postgres:<version> Also podman pod is not the right command to create a container. Pods provide Infrastructure for containers. Read more here: https://developers.redhat.com/blog/2019/01/15/podman-managing-containers-pods

    In your case i would run something like this:

    podman create -it --name postgress-container -p 8080:8080 postgres:15.1
    

    but if you start this container it won't run, because you need to set initial postgres password, like so:

    podman create -it --name postgress-container -e POSTGRES_PASSWORD=mysecretpassword -p 8080:8080 postgres:15.1
    

    or better formatted:

    podman create -it --name postgress-container \
    -e POSTGRES_PASSWORD=mysecretpassword \
    -p 8080:8080 \
    postgres:15.1
    

    See also docs from postgesql on dockerhub: https://hub.docker.com/_/postgres/

    Most docker commands can be made to docker commands by replacing docker with podman.