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
 

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
05-07 15:11