Jenkins wrong volume permissions

后端 未结 8 1046
迷失自我
迷失自我 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

    As haschibaschi stated your user in the container has different userid:groupid than the user on the host.

    To get around this is to start the container without the (problematic) volume mapping, then run bash on the container:

    docker run -p 8080:8080 -p 50000:50000 -it jenkins bin/bash
    

    Once inside the container's shell run the id command and you'll get results like:

    uid=1000(jenkins) gid=1000(jenkins) groups=1000(jenkins)
    

    Exit the container, go to the folder you are trying to map and run:

    chown -R 1000:1000 .
    

    With the permissions now matching, you should be able to run the original docker command with the volume mapping.

提交回复
热议问题