如何进入docker 使用root用户的方式

来源:互联网 发布:蜘蛛侠巅峰能力数据 编辑:程序博客网 时间:2024/06/03 20:41

参考:

https://stackoverflow.com/questions/35734474/connect-to-docker-container-as-user-other-than-root

执行命令:

docker exec -it --user root <container id> /bin/bash



进入之后直接显示的是root 用户

原创粉丝点击