Docker Container Pause/Unpause

docker container pause This command will pause all processes within one or more containers.

Syntax

docker pause CONTAINER [CONTAINER...]

Examples

learning-ocean:~ gaurav$ docker container ls
CONTAINER ID   IMAGE     COMMAND                  CREATED         STATUS         PORTS            NAMES
cb4a3f67a222   nginx     "/docker-entrypoint.…"   5 seconds ago   Up 4 seconds   80/tcp           eloquent_chatelet
learning-ocean:~ gaurav$ docker container pause cb
cb

Now list the container and check the status of the container it's showing as Paused

learning-ocean:~ gaurav$ docker container ls
CONTAINER ID   IMAGE     COMMAND                  CREATED          STATUS                   PORTS           NAMES
cb4a3f67a222   nginx     "/docker-entrypoint.…"   16 seconds ago   Up 15 seconds (Paused)   80/tcp          eloquent_chatelet

You can unpause it simply using the below command-

Example

docker unpause CONTAINER [CONTAINER...]
learning-ocean:~ gaurav$ docker container unpause cb
cb

learning-ocean:~ gaurav$ docker container ls
CONTAINER ID   IMAGE     COMMAND                  CREATED         STATUS         PORTS              NAMES
cb4a3f67a222   nginx     "/docker-entrypoint.…"   3 minutes ago   Up 3 minutes   80/tcp             eloquent_chatelet

learning-ocean:~ gaurav$