.TH "DOCKER" "1" "Feb 2021" "Docker Community" "" .nh .ad l .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 .PP .RS .nf $ 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 \- .fi .RE .SH Display comments in the image history .PP The \fB\fCdocker commit\fR command has a \fB\-m\fP flag for adding comments to the image. These comments will be displayed in the image history. .PP .RS .nf $ 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 \- .fi .RE .SS Format the output .PP The formatting option (\fB\fC\-\-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 . \fB\fCPlaceholder\fR \fB\fCDescription\fR \fB\fC\&.ID\fR Image ID \fB\fC\&.CreatedSince\fR T{ Elapsed time since the image was created if \fB\fC\-\-human=true\fR, otherwise timestamp of when image was created T} \fB\fC\&.CreatedAt\fR T{ Timestamp of when image was created T} \fB\fC\&.CreatedBy\fR T{ Command that was used to create the image T} \fB\fC\&.Size\fR Image disk size \fB\fC\&.Comment\fR Comment for image .TE .PP When using the \fB\fC\-\-format\fR option, the \fB\fChistory\fR command will either output the data exactly as the template declares or, when using the \fB\fCtable\fR directive, will include column headers as well. .PP The following example uses a template without headers and outputs the \fB\fCID\fR and \fB\fCCreatedSince\fR entries separated by a colon for all images: .PP .RS .nf $ 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 .fi .RE .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 numeric IDs .SH SEE ALSO .PP \fBdocker\-image(1)\fP