I have a virtual machine hosting Oracle Linux where I\'ve installed Docker and created containers using a docker-compose file. I placed the jenkins volume under a shared fol
The problem is, that your user in the container has different userid:groupid as the user on the host.
you have two possibilities:
You can ensure that the user in the container has the same userid:groupid like the user on the host, which has access to the mounted volume. For this you have to adjust the user in the Dockerfile. Create a user in the dockerfile with the same userid:groupid and then switch to this user https://docs.docker.com/engine/reference/builder/#user
You can ensure that the user on the host has the same userid:groupid like the user in the container. For this, enter the container with docker exec -it
and show the user id id -u
group id id -G
. Change the permissions of the mounted volume to this userid:groupid.