Skip to content

Latest commit

 

History

History
109 lines (81 loc) · 2.44 KB

File metadata and controls

109 lines (81 loc) · 2.44 KB

Docker Images

Images are the read-only templates used to create containers. These commands handle building, downloading, and managing images.

List images

View all local images. #ls #images

docker images

Build an image

Build an image from a Dockerfile in the current directory. #make #compile

docker build -t $tag_name .

Pull an image

Download an image from a registry (like Docker Hub). #download #fetch

docker pull $image_name

Push an image

Upload an image to a registry. #upload #publish

docker push $image_push

Remove an image

Delete an image from your local system. Use --force if it is being used by a stopped container. #rmi #delete #purge

docker rmi $rm_opts $image

Tag an image

Create a new tag that refers to an existing image. #alias #rename

docker tag $image $new_tag

Show image history

Show the layers and history of an image. #layers #details

docker history $image

Save an image

Save one or more images to a tar archive for offline sharing. #export #tar #backup

docker save -o $file_name $image

Load an image

Load an image from a tar archive. #import #restore

docker load -i $file_name