Miscellaneous Docker Commands

Below are a minimal set of Docker command that you need to know to work with containers.

To open a shell window on an existing running container:

  • Use the following command with the container ID from the docker ps results:
    # docker exec -it [container ID or Name] /bin/bash

To stop a running container:

  • Use the following command:
    # docker stop [container ID or Name]

Docker stop stops all processes running in the container meaning any data in memory is lost and there is no CPU consumption, but the filesystem state of the container is preserved. It also shuts down the docker engine process on the host.

Docker start will restart the docker engine, restore from the saved filesystem state, and relaunch processes. Zixi licenses are preserved when containers are stopped and started.

To start a stopped container:

  • Use the following command:
    # docker start [container ID or Name]

To pause a running container:

  • Use the following command:
    # docker pause [container ID or Name]

Docker pause freezes all processes running in the container. Memory state is preserved as well as filesystem states, but there is no CPU consumption. The docker engine process on the host remains active.

Docker unpause will unfreeze the processes running in the container. Zixi licenses are preserved when containers are paused and unpaused.

To unpause a paused container:

  • Use the following command:
    # docker unpause [container ID or Name]

To remove a container:

  • Use the following command:
    # docker rm [container ID or Name]

After you have removed the container that uses an image, you can remove the image.

To remove an image:

  • Use the following command:

  • # docker image rm [image ID or Name}