Consider:
docker run -it centos /bin/bash
I pressed Ctrl+D to exit it.
I wa
You can restart an existing container after it exited and your changes are still there.
docker start `docker ps -q -l` # restart it in the background docker attach `docker ps -q -l` # reattach the terminal & stdin