Image
Build
docker build -t <image_name>
Ex: docker build -t demo .
To build an image from a Dockerfile.
Images
docker images
To list images.
Commit
docker commit <container_name>
To create a new image from a container’s changes.
Load
docker load
Ex: docker load < myimage.tar
To load an image from a tar archive or STDIN.
History
docker history <container_name>
To show the history of an image.
Import
docker import
To import the contents from a tarball to create a filesystem image.
Remove
docker rmi <container_name>
To remove one or more images.
Save
docker save <container_name>
Ex: docker save myimage:latest > myimage.tar
To save images to a tar archive or STDOUT.
Tag
docker tag
Ex: docker tag demo:latest test:v1
To tag an image into a repository.
Restart
docker restart <cont_id>
Restart an existing running container.
Kill
docker kill <cont_id>
Delete running container forcefull.
Pause and Unpause
docker pause <cont_id>
docker unpause <cont_id>
Prune
docker system prune
Remove Unused images, volumes and networks.
Rename
docker rename <old_container_name> <new_container_name>
Renames an existing container.
Last updated