Docker replicate UID/GID in container from host

后端 未结 2 1334
暖寄归人
暖寄归人 2020-12-15 01:30

When creating Docker containers I keep running into the issue of the UID/GID not being reflected in the container (I realize this is by design). What I am looking for is a

2条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-15 02:00

    I had similar issues and typically included entrypoint scripts in every image as it has already been mentioned (using https://github.com/ncopa/su-exec for interactive terminal programs). However, I kept repeating the same steps in multiple Dockerfiles. But after I used "docker.inside" from Jenkins Pipeline which does the user id handling auto-magically, I decided to build a Python 3 package based on docker-py to do this in a (hopefully) similar way (with some extended features I found helpful):

    https://github.com/boon-code/docker-inside

    I realize that the post is rather old; Maybe it's still helpful to someone with the same problem...

提交回复
热议问题