docker pause
Table of Contents:
Command Name:
docker pause
Description:
Pause all processes within one or more containers.
Syntax:
easywhatis$ docker pause --help
Usage: docker pause CONTAINER [CONTAINER...]
Pause all processes within one or more containers
easywhatis$
Example:
easywhatis$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a5bb226d1850 ubuntu "bash" 7 hours ago Exited (137) 36 minutes ago eloquent_knuth
easywhatis$ docker pause a5bb226d1850
Error response from daemon: Container a5bb226d185066ff331b3ca4b82825785d3fa4da18cba00993045c823f92db90 is not running
easywhatis$ docker start a5bb226d1850
a5bb226d1850
easywhatis$ docker pause a5bb226d1850
a5bb226d1850
easywhatis$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a5bb226d1850 ubuntu "bash" 7 hours ago Up 4 seconds (Paused) eloquent_knuth
easywhatis$ docker exec -it a5bb226d1850 /bin/bash
Error response from daemon: Container a5bb226d1850 is paused, unpause the container before exec
easywhatis$ docker start a5bb226d1850
Error response from daemon: cannot start a paused container, try unpause instead
Error: failed to start containers: a5bb226d1850
easywhatis$ docker unpause a5bb226d1850
a5bb226d1850
easywhatis$ docker exec -it a5bb226d1850 /bin/bash
root@a5bb226d1850:/# pwd
/
root@a5bb226d1850:/# exit
exit
easywhatis$