Docker-- container command (basic)

New and launch container

docker run [options] IMAGE [command] [args…]

Here Insert Picture Description

Start an interactive container:
Here Insert Picture Description

Lists all currently running container

docker ps [options]
Here Insert Picture Description

Here Insert Picture Description

Exit container

method one:exitContainer stops the exit
way:ctrl+P+Q The container does not stop exit

Start container

docker start container or container name ID

Restart container

docker restart ID container or container name

Stop the container

docker stop container or containers ID name

Forced to stop container

docker kill container or container name ID

To delete a stopped container

docker rm container ID

Delete multiple containers:

  • docker rm -f $(docker ps -a -q)
  • docker ps -a -q | xargs docker rm
Published 584 original articles · won praise 1815 · Views 220,000 +

Guess you like

Origin blog.csdn.net/cold___play/article/details/103950882