How to use sudo inside a docker container?

前端 未结 11 750
臣服心动
臣服心动 2020-11-30 16:17

Normally, docker containers are run using the user root. I\'d like to use a different user, which is no problem using docker\'s USER directive. But this use

11条回答
  •  时光取名叫无心
    2020-11-30 16:41

    This may not work for all images, but some images contain a root user already, such as in the jupyterhub/singleuser image. With that image it's simply:

    USER root
    RUN sudo apt-get update
    

提交回复
热议问题