Docker using gosu vs USER

后端 未结 3 1583
难免孤独
难免孤独 2021-01-30 02:29

Docker kind of always had a USER command to run a process as a specific user, but in general a lot of things had to run as ROOT.

I have see

3条回答
  •  时光说笑
    2021-01-30 02:50

    I am using gosu and entrypoint.sh because I want the user in the container to have the same UID as the user that created the container.

    Docker Volumes and Permissions.

    The purpose of the container I am creating is for development. I need to build for linux but I still want all the connivence of local (OS X) editing, tools, etc. My keeping the UIDs the same inside and outside the container it keeps the file ownership a lot more sane and prevents some errors (container user cannot edit files in mounted volume, etc)

提交回复
热议问题