How to add users to Docker container?

后端 未结 8 1220
无人及你
无人及你 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 18:03

    You can imitate open source Dockerfile, for example:

    Node: node12-github

    RUN groupadd --gid 1000 node \
        && useradd --uid 1000 --gid node --shell /bin/bash --create-home node
    

    superset: superset-github

    RUN useradd --user-group --create-home --no-log-init --shell /bin/bash 
        superset
    

    I think it's a good way to follow open source.

提交回复
热议问题