初学 Docker

初学 docker,还是懵懵懂懂的状态。

Pull Ubuntu:

docker pull ubuntu

Run Ubuntu:

docker run -i -t ubuntu /bin/bash

Mount Volume:

docker run -i -t -v /etc/nginx:/etc/nginx ubuntu /bin/bash

Delete all container:

docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)

Exit 后找回 container:

docker ps -a

重启 container:

docker restart xxx

重新进入 container:

docker attach xxx

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.