.nh .TH "DOCKER" "1" "Jan 2024" "Docker Community" "Docker User Manuals" .SH NAME .PP docker-image-history - Show the history of an image .SH SYNOPSIS .PP \fBdocker image history [OPTIONS] IMAGE\fP .SH DESCRIPTION .PP Show the history of when and how an image was created. .SH EXAMPLES .EX $ docker history fedora IMAGE CREATED CREATED BY SIZE COMMENT 105182bb5e8b 5 days ago /bin/sh -c #(nop) ADD file:71356d2ad59aa3119d 372.7 MB 73bd853d2ea5 13 days ago /bin/sh -c #(nop) MAINTAINER Lokesh Mandvekar 0 B 511136ea3c5a 10 months ago 0 B Imported from - .EE .SH Display comments in the image history .PP The \fBdocker commit\fR command has a \fB-m\fP flag for adding comments to the image. These comments will be displayed in the image history. .EX $ sudo docker history docker:scm IMAGE CREATED CREATED BY SIZE COMMENT 2ac9d1098bf1 3 months ago /bin/bash 241.4 MB Added Apache to Fedora base image 88b42ffd1f7c 5 months ago /bin/sh -c #(nop) ADD file:1fd8d7f9f6557cafc7 373.7 MB c69cab00d6ef 5 months ago /bin/sh -c #(nop) MAINTAINER Lokesh Mandvekar 0 B 511136ea3c5a 19 months ago 0 B Imported from - .EE .SS Format the output .PP The formatting option (\fB--format\fR) will pretty-prints history output using a Go template. .PP Valid placeholders for the Go template are listed below: .TS allbox; l l l l . \fBPlaceholder\fP \fBDescription\fP \fB\&.ID\fR Image ID \fB\&.CreatedSince\fR T{ Elapsed time since the image was created if \fB--human=true\fR, otherwise timestamp of when image was created T} \fB\&.CreatedAt\fR T{ Timestamp of when image was created T} \fB\&.CreatedBy\fR T{ Command that was used to create the image T} \fB\&.Size\fR Image disk size \fB\&.Comment\fR Comment for image .TE .PP When using the \fB--format\fR option, the \fBhistory\fR command will either output the data exactly as the template declares or, when using the \fBtable\fR directive, will include column headers as well. .PP The following example uses a template without headers and outputs the \fBID\fR and \fBCreatedSince\fR entries separated by a colon for all images: .EX $ docker images --format "{{.ID}}: {{.CreatedSince}} ago" cc1b61406712: 2 weeks ago : 2 weeks ago : 2 weeks ago : 2 weeks ago : 2 weeks ago : 3 weeks ago : 3 weeks ago : 3 weeks ago .EE .SH OPTIONS .PP \fB--format\fP="" Pretty-print images using a Go template .PP \fB-h\fP, \fB--help\fP[=false] help for history .PP \fB-H\fP, \fB--human\fP[=true] Print sizes and dates in human readable format .PP \fB--no-trunc\fP[=false] Don't truncate output .PP \fB-q\fP, \fB--quiet\fP[=false] Only show image IDs .SH SEE ALSO .PP \fBdocker-image(1)\fP