Connect to docker container as user other than root

后端 未结 9 1033
没有蜡笔的小新
没有蜡笔的小新 2020-12-13 01:38

BY default when you run

docker run -it [myimage]

OR

docker attach [mycontainer]

you connect to the terminal as r

9条回答
  •  抹茶落季
    2020-12-13 02:03

    Execute command as www-data user: docker exec -t --user www-data container bash -c "ls -la"

提交回复
热议问题