Docker Config Reference (docker history)

We put out many examples of using docker history!

Docker Config Reference (docker history)
docker history example guide 

Example 1

docker history nginx:latest

This command displays the build history of the "nginx:latest" image, listing layers with details such as creation time, size, and commands, which is fundamental for understanding the composition of a web server image in deployment analysis.

Example 2

docker history --human=false alpine:3.18

This command shows the history of the "alpine:3.18" image with raw sizes (e.g., in bytes instead of human-readable formats like MB), enabling precise storage calculations for minimalistic base images.

Example 3

docker history --format "{{.ID}} {{.CreatedBy}}" ubuntu:24.04

This command formats the output for the "ubuntu:24.04" image to include only layer IDs and creation commands, facilitating scripted parsing for build process audits.

Example 4

docker history --quiet mysql:8.0

This command outputs only the layer IDs of the "mysql:8.0" image in quiet mode, which is suitable for automation tasks requiring concise identifiers without additional details.

Example 5

docker history --no-trunc node:20

This command displays the full, untruncated details (e.g., complete command strings) for the "node:20" image history, aiding in thorough examination of JavaScript runtime layers.

Example 6

docker history sha256:abcdef1234567890

This command retrieves the history using a partial image digest "sha256:abcdef1234567890", ensuring specificity when multiple tags reference the same image.

Example 7

docker history --format "table {{.Created}} {{.Size}}" redis:7

This command presents the history of the "redis:7" image in a tabular format, showing creation times and sizes, which supports resource usage reporting.

Example 8

docker history --human=true python:3.12

This command enables human-readable sizes (default behavior) for the "python:3.12" image history, enhancing readability for scripting language runtime evaluations.

Example 9

docker history busybox:latest

This command lists the minimal history of the "busybox:latest" image, ideal for inspecting lightweight utility images with few layers.

Example 10

docker history --quiet --no-trunc golang:1.21

This command combines quiet mode with full details for the "golang:1.21" image, outputting complete layer IDs without truncation for precise referencing.

Example 11

docker history hello-world

This command displays the history of the simple "hello-world" test image, demonstrating basic image structure for educational or verification purposes.

Example 12

docker history --format "{{json .}}" openjdk:21

This command formats each layer of the "openjdk:21" image history as JSON, enabling integration with JSON-processing tools for Java runtime analysis.

Example 13

docker history postgres:16

This command shows the layered history of the "postgres:16" database image, assisting in understanding database initialization steps.

Example 14

docker history --human=false --quiet mongo:7

This command outputs raw, quiet layer IDs for the "mongo:7" image, suitable for storage-optimized checks in NoSQL database contexts.

Example 15

docker history apache/httpd:latest

This command retrieves the history of the "apache/httpd:latest" image, revealing web server configuration layers for HTTP service reviews.

Example 16

docker history --no-trunc --format "{{.CreatedBy}}" jenkins/jenkins:lts

This command lists full creation commands without truncation for the "jenkins/jenkins:lts" image, supporting CI/CD pipeline image inspections.

Example 17

docker history wordpress:latest

This command displays the history of the "wordpress:latest" CMS image, helping identify plugin or theme installation layers.

Example 18

docker history --quiet rabbitmq:3-management

This command quietly lists layer IDs for the "rabbitmq:3-management" image, for message queue system verifications.

Example 19

docker history elasticsearch:8

This command shows the history of the "elasticsearch:8" search engine image, aiding in understanding indexing and plugin layers.

Example 20

docker history --human=true --format "table {{.ID}}\t{{.Size}}" grafana/grafana

This command tabulates IDs and human-readable sizes for the "grafana/grafana" monitoring image history.

Example 21

docker history prom/prometheus

This command lists the history of the "prom/prometheus" metrics image, for observability tool layer analysis.

Example 22

docker history --no-trunc tensorflow/tensorflow:latest

This command provides untruncated details for the "tensorflow/tensorflow:latest" ML image history, revealing framework installation steps.

Example 23

docker history jupyter/base-notebook

This command displays the history of the "jupyter/base-notebook" data science image, identifying notebook server layers.

Example 24

docker history --format "{{.Comment}}" bitnami/minio

This command extracts comments from the history of the "bitnami/minio" storage image, for build annotation reviews.

Example 25

docker history vault:1.15

This command shows the history of the "vault:1.15" secrets management image, supporting security tool inspections.

Example 26

docker history --quiet consul:1.17

This command quietly outputs layer IDs for the "consul:1.17" service discovery image.

Example 27

docker history traefik:v3.0

This command lists the history of the "traefik:v3.0" reverse proxy image, for networking layer evaluations.

Example 28

docker history --human=false sonarqube:10

This command provides raw sizes in the history of the "sonarqube:10" code quality image.

Example 29

docker history artifactory:7

This command displays the history of the "artifactory:7" repository manager image, identifying artifact storage layers.

Example 30

docker history --no-trunc --quiet keycloak/keycloak

This command combines no-truncation with quiet mode for full layer IDs of the "keycloak/keycloak" identity image.