New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docker inspect format returns different date format than inspect #14164
Comments
Using
Whereas,
Filtering on just .State has the same issue:
docker version docker info uname -a |
This is because of the way the template is rendered with plain go objects. |
as per my previous comment I think this issue should be closed but feel free to ping me if I'm mistaken and I'll reopen it |
This bug is still present in Docker 18.03, both in |
Trying on Docker 18.06.1; Default output;
String presentation
String presentation (only
JSON presentation
|
In Docker version 19.03.4, build 9013bf583a there are still some inconsistencies when the timestamp is not stored with UTC ("Z") timezone , but with the explicit "json" prefix this can be solved: $ docker image inspect -f '{{.Metadata.LastTagTime}}' 91858d4f2d4c $ docker image inspect -f '{{json .Metadata.LastTagTime}}' 91858d4f2d4c For ".Created" which is stored with "Z" timezone there is no difference besides the quotes: $ docker image inspect -f '{{.Created}}' 91858d4f2d4c |
Honestly, I'd open a new issue for this. This issue is almost 5 years old and has been closed nearly since it opened. The consensus for the initial issue seemed to be use |
Relevant issues/pull requests:
#11706
#7670
Summary:
The
docker inspect
command issued with a-f
formatting flag will cause times to be displayed in a manner that is inconsistent with the rest of the API.Expected
Dates returned by
docker inspect
match dates returned bydocker inspect -f
identically, including formatting.Observed
Dates do not match in formatting. One features a non-standard format.
Reproduce by:
docker inspect
command on a containerdocker inspect -f {.State}
to format the output and display an object that has a time in it.Environment
docker version
:docker info
:uname -a
The text was updated successfully, but these errors were encountered: