As the title says,
sudo docker run -it resin/rpi-raspbian /bin/bash
Theoretically speaking, bash has not been closed and should be usable, but why, check after each run
sudo docker ps
There are no running images.
pass
sudo docker run -it resin/rpi-raspbian /bin/echo "hello world"
//或者
sudo docker ps -a
It can be verified that docker has been executed and then exited. Adding the -it command should enter the bash of the image and then interact, but it does not. How to deal with this situation...
Docker version 1.12.6, build 78d1802
phpcn_u15822017-05-24 11:34:56
1. Docker run -it Please do not use CTRL+C
退出
2.使用CTRL+P+Q
to exit the internal session of the current container, it will run in the background.
If your problem is not solved, please try to check the log information
$docker logs ${container_id}
Docker will default the internal pid of the container to 1 as the identifier. If 1 dies, the container will die. After echo "hello", the pid will die, and then the natural container will die.
In the official documentation, the use of run -it in the docker cli introduction is as follows
Docs