'\" t
.nh
.TH "DOCKER" "1" "Jun 2026" "Docker Community" "Docker User Manuals"

.SH NAME
docker-image-history - Show the history of an image


.SH SYNOPSIS
\fBdocker image history [OPTIONS] IMAGE\fP


.SH DESCRIPTION
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
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
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
<missing>: 2 weeks ago
<missing>: 2 weeks ago
<missing>: 2 weeks ago
<missing>: 2 weeks ago
<missing>: 3 weeks ago
<missing>: 3 weeks ago
<missing>: 3 weeks ago
.EE


.SH OPTIONS
\fB--format\fP=""
	Format output using a custom template:
\&'table':            Print output in table format with column headers (default)
\&'table TEMPLATE':   Print output in table format using the given Go template
\&'json':             Print in JSON format
\&'TEMPLATE':         Print output using the given Go template.
Refer to https://docs.docker.com/go/formatting/ for more information about formatting output with templates

.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--platform\fP=""
	Show history for the given platform. Formatted as "os[/arch[/variant]]" (e.g., "linux/amd64")

.PP
\fB-q\fP, \fB--quiet\fP[=false]
	Only show image IDs


.SH SEE ALSO
\fBdocker-image(1)\fP
