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