[Docker] Container & image (docker run)

image: stopped container

Run a container:

docker run -d --name web -p 80:8080 nigelpoulton/pluralsight-docker-ci

Run in background.

Stop it:

docker stop web

Start it again:

docker start web

Stop all the running containers:

docker stop $(docker ps -aq)

Remove all the containers:

docker rm $(docker ps -aq)

remove all images:

docker rmi $(docker images -q)
原文地址:https://www.cnblogs.com/Answer1215/p/6517648.html