How to add users to Docker container?

后端 未结 8 1242
无人及你
无人及你 2020-11-28 17:07

I have a docker container with some processes (uwsgi and celery) running inside. I want to create a celery user and a uwsgi user for these processes as well as a worker grou

8条回答
  •  伪装坚强ぢ
    2020-11-28 17:57

    To avoid the interactive questions by adduser, you can call it with these parameters:

    RUN adduser --disabled-password --gecos '' newuser
    

    The --gecos parameter is used to set the additional information. In this case it is just empty.

    On systems with busybox (like Alpine), use

    RUN adduser -D -g '' newuser
    

    See busybox adduser

提交回复
热议问题