-format
(Format Output)
Meaning: Formats the output of the inspect
command.
Usage: Allows specifying a custom format for the output.
Example: docker inspect --format '{{.Config.Env}}' my-image
displays environment variables of my-image
.
docker inspect --format '{{json .}}' <image_id>
-all
(All Unused)
docker image prune --all
Meaning: Removes all unused images, not just dangling ones.
Usage: Cleans up all images that are not currently used by any containers.
Example: docker image prune --all
removes all unused images.
-filter
(Filter)
docker image prune --filter "label=<key>=<value>"
Meaning: Filters images to prune based on specified criteria.
Usage: Allows selective pruning based on labels or other criteria.
Example: docker image prune --filter "until=24h"
removes images not used in the last 24 hours.
o
(Output File)Meaning: Saves an image to a tar archive file.
Usage: Useful for backing up or transferring images.
Example: docker save -o my-image.tar my-image
saves my-image
to my-image.tar
.
docker save -o <output_file> <image>
i
(Input File)Meaning: Loads an image from a tar archive file.
Usage: Imports images from tar files.
Example: docker load -i my-image.tar
loads the image from my-image.tar
.
docker load -i <input_file>