Jenkins wrong volume permissions

后端 未结 8 1078
迷失自我
迷失自我 2020-12-16 14:39

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

8条回答
  •  自闭症患者
    2020-12-16 15:33

    The problem is, that your user in the container has different userid:groupid as the user on the host.

    you have two possibilities:

    1. 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

    2. 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 bash and show the user id id -u group id id -G . Change the permissions of the mounted volume to this userid:groupid.

提交回复
热议问题