Podman: Volume Mounting

When you try to mount local folder into the container, but it gives you an error such as:

find: ‘/var/lib/mysql/’: Permission denied
chown: changing ownership of '/var/lib/mysql/': Permission denied
find: ‘/var/lib/rabbitmq’: Permission denied
chown: changing ownership of '/var/lib/rabbitmq': Permission denied

Then what you need to do is to append :Z at the end of the -v flag.

# FROM
podman run -d -v $PWD/mariadb:/var/lib/mariadb mariadb
# TO
podman run -d -v $PWD/mariadb:/var/lib/mariadb:z mariadb

References:


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *