su : must be run from a terminal

After some googling, I found the solution from Tero's glob. If you have python installed, just run the following from your shell:

echo "import pty; pty.spawn('/bin/bash')" > /tmp/asdf.py
python /tmp/asdf.py

30 down vote
 

You can log into the Docker Image using the root user (ID = 0) instead of the provided default user when you use the -u option. E.g.

docker exec -u 0 -it mycontainer bash

root (id = 0) is the default user within a container. The image developer can create additional users. Those users are accessible by name. When passing a numeric ID, the user does not have to exist in the container.

相关文章:

  • 2021-08-13
  • 2021-09-03
  • 2022-01-30
  • 2021-11-28
  • 2022-12-23
  • 2021-11-13
  • 2021-08-02
  • 2021-07-27
猜你喜欢
  • 2022-12-23
  • 2021-10-15
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-19
相关资源
相似解决方案