New and launch container
docker run [options] IMAGE [command] [args…]
Start an interactive container:
Lists all currently running container
docker ps [options]
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