How to continue a Docker container which has exited

前端 未结 10 1938
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-29 14:51

Consider:

docker run -it centos /bin/bash

I pressed Ctrl+D to exit it.

I wa

10条回答
  •  一整个雨季
    2020-11-29 15:03

    by name

    sudo docker start bob_the_container
    

    or by Id

    sudo docker start aa3f365f0f4e
    

    this restarts stopped container, use -i to attach container's STDIN or instead of -i you can attach to container session (if you run with -it)

    sudo docker attach bob_the_container
    

提交回复
热议问题