Search code examples
devopscentos8podmanquay.iopodman-compose

podman not running container in quay setup in centos9


I am setting up quay in a vm with centos distro. This is the guide I am following: quay deploy guide

once I install Podman I am trying to run first container with below command:

I set up this env variable:

export QUAY=QUAY

and made a dir of same name in home:

mkdir QUAY

once I install Podman I am trying to run first container with below command:

$ sudo podman run -d --rm --name postgresql-quay \
  -e POSTGRESQL_USER=quayuser \
  -e POSTGRESQL_PASSWORD=quaypass \
  -e POSTGRESQL_DATABASE=quay \
  -e POSTGRESQL_ADMIN_PASSWORD=adminpass \
  -p 5432:5432 \
  -v $QUAY/postgres-quay:/var/lib/pgsql/data:Z \
  registry.redhat.io/rhel8/postgresql-10:1

and I am getting following error:

sudo podman run -d --rm --name postgresql-quay   -e POSTGRESQL_USER=quayuser   -e POSTGRESQL_PASSWORD=quaypass   -e POSTGRESQL_DATABASE=quay   -e POSTGRESQL_ADMIN_PASSWORD=adminpass   -p 5432:5432   -v QUAY/postgres-quay:/var/lib/pgsql/data:Z   registry.redhat.io/rhel8/postgresql-10:1
Error: error creating named volume "QUAY/postgres-quay": error running volume create option: names must match [a-zA-Z0-9][a-zA-Z0-9_.-]*: invalid argument

Solution

  • The bind mount needs to be specified as an absolute path or a relative path that starts with ./ or ../.

    In other words instead of

    -v QUAY/postgres-quay:/var/lib/pgsql/data:Z

    use

    -v ./QUAY/postgres-quay:/var/lib/pgsql/data:Z

    (I replaced $QUAY with its value QUAY)