Root password inside a Docker container

前端 未结 16 711
没有蜡笔的小新
没有蜡笔的小新 2020-12-02 03:24

I\'m using a Docker image which was built using the USER command to use a non-root user called dev. Inside a container, I\'m \"dev\", but I want to edit the

16条回答
  •  不思量自难忘°
    2020-12-02 04:07

    I am able to get it working with the below command.

    root@gitnew:# docker exec -it --user $(username) $(containername) /bin/bash
    

提交回复
热议问题