Image

  1. Build

docker build -t <image_name> 
Ex: docker build -t demo .

To build an image from a Dockerfile.

  1. Images

docker images

To list images.

  1. Commit

docker commit <container_name>

To create a new image from a container’s changes.

  1. Load

docker load
Ex: docker load < myimage.tar

To load an image from a tar archive or STDIN.

  1. History

docker history <container_name>

To show the history of an image.

  1. Import

docker import

To import the contents from a tarball to create a filesystem image.

  1. Remove

docker rmi <container_name>

To remove one or more images.

  1. Save

docker save <container_name>
Ex: docker save myimage:latest > myimage.tar

To save images to a tar archive or STDOUT.

  1. Tag

docker tag
Ex: docker tag demo:latest test:v1 

To tag an image into a repository.

  1. Restart

docker restart <cont_id>

Restart an existing running container.

  1. Kill

docker kill <cont_id>

Delete running container forcefull.

  1. Pause and Unpause

docker pause <cont_id>
docker unpause <cont_id>
  1. Prune

docker system prune

Remove Unused images, volumes and networks.

  1. Rename

docker rename <old_container_name> <new_container_name>

Renames an existing container.

Last updated