Where can I configure the start user UID for Docke

2019-07-17 06:36发布

Where can I configure the start user UID for Docker containers? By default it uses UID 999 which conflicts with some other users on my system.

1条回答
放荡不羁爱自由
2楼-- · 2019-07-17 07:13

In your Dockerfile, run the following command:

RUN groupadd -r -g 1234 newusername && useradd -r -u 1234 -g newusername newusername
USER newusername

This will create a user newusername with GID 1234 and UID 1234, then run the container with a default user newusername.

查看更多
登录 后发表回答