Skip to content
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 compatibility: Created timestamp returned by image list is in wrong format #6796

Closed
skorhone opened this issue Jun 27, 2020 · 11 comments
Assignees
Labels
HTTP API Bug is in RESTful API kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@skorhone
Copy link

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description

Podman's /images/json endpoint returns created timestamp as a string. Docker returns created timestamp in unix time. Different format causes popular tools such as testcontainers to fail.

Steps to reproduce the issue:

  1. podman system service --log-level=debug --time=0 unix:///tmp/podman.sock

  2. curl --unix-socket /tmp/podman.sock "http://localhost/images/json" -v

Describe the results you received:

"Created":"2020-06-23T11:06:02.096204727Z"

Describe the results you expected:

"Created": 1592924762000

Additional information you deem important (e.g. issue happens only occasionally):

Output of podman version:

Version:      2.0.0
API Version:  1
Go Version:   go1.13.8
Built:        Thu Jan  1 02:00:00 1970
OS/Arch:      linux/amd64
@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Jun 27, 2020
@mheon mheon added the HTTP API Bug is in RESTful API label Jun 27, 2020
@mheon
Copy link
Member

mheon commented Jun 27, 2020

@baude PTAL

@baude
Copy link
Member

baude commented Jun 27, 2020

https://docs.docker.com/engine/api/v1.40/#operation/ImageInspect suggests that our current format is correct. I will keep digging to see if the documentation is in error.

@baude
Copy link
Member

baude commented Jun 27, 2020

Also just checked on ubuntu docker.

Docker version 19.03.8, build afacb8b7f0
ubuntu@ubuntu:~$ sudo curl --unix-socket /var/run/docker.sock http://localhost/images/alpine/json | jq .Created
"2020-05-29T21:19:46.363518345Z"

@skorhone
Copy link
Author

skorhone commented Jun 27, 2020

For inspect endpoint that is correct behavior, but for list of images created timestamp should be formatted as unix time (integer).

(This doesn't make any sense from API user perspective)

https://docs.docker.com/engine/api/v1.40/#operation/ImageList

@skorhone skorhone changed the title Docker compatibility: Created timestamp for an image is in wrong format Docker compatibility: Created timestamp returned by image list is in wrong format Jun 27, 2020
@baude
Copy link
Member

baude commented Jun 28, 2020

@skorhone my apologies. you are correct as i misread the report. this is why i shouldnt work on the weekends. confirmed as bug.

@ebramirez
Copy link

The PR was merged, should this issue be closed?

@skorhone
Copy link
Author

skorhone commented Jul 3, 2020

I think we can close it.

@skorhone skorhone closed this as completed Jul 3, 2020
@max-arnold
Copy link

It looks like the issue isn't fixed:

% sudo podman image pull ubuntu:18.04

Trying to pull docker.io/library/ubuntu:18.04...
Getting image source signatures
Copying blob d13af8ca898f done
Copying blob 70799171ddba done
Copying blob b6c12202c5ef done
Copying blob 7595c8c21622 done
Copying config 2eb2d388e1 done
Writing manifest to image destination
Storing signatures
2eb2d388e1a255c98029f40d6d7f8029fb13f1030abc8f11ccacbca686a8dc12
% sudo podman images

REPOSITORY                TAG     IMAGE ID      CREATED      SIZE
docker.io/library/ubuntu  18.04   2eb2d388e1a2  10 days ago  66.6 MB

Note the Created timestamp format:

% sudo curl --unix-socket /run/podman/podman.sock http://d/v1.35/images/docker.io/library/ubuntu:18.04/json

{"Id":"sha256:2eb2d388e1a255c98029f40d6d7f8029fb13f1030abc8f11ccacbca686a8dc12","RepoTags":["docker.io/library/ubuntu:18.04"],"RepoDigests":["docker.io/library/ubuntu@sha256:767eea1efb29ab7e215e1d97c8d758df5d587ca86e769a2dfb254c6b022895c3","docker.io/library/ubuntu@sha256:a61728f6128fb4a7a20efaa7597607ed6e69973ee9b9123e3b4fd28b7bba100b"],"Parent":"","Comment":"","Created":"2020-07-24T14:38:22.027273323Z","Container":"eb731db74ec67b789f444e92270caaa9978f8156b6f168c9b24a33c8fb86c9bc","ContainerConfig":{"Hostname":"eb731db74ec6","Domainname":"","User":"","AttachStdin":false,"AttachStdout":false,"AttachStderr":false,"Tty":false,"OpenStdin":false,"StdinOnce":false,"Env":["PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"],"Cmd":["/bin/sh","-c","#(nop) ","CMD [\"/bin/bash\"]"],"ArgsEscaped":true,"Image":"sha256:d70b4aa31e228d7eec1d350f2306d75a50b591c117441e8983f49d0b528d3896","Volumes":null,"WorkingDir":"","Entrypoint":null,"OnBuild":null,"Labels":{}},"DockerVersion":"18.09.7","Author":"","Config":{"Hostname":"","Domainname":"","User":"","AttachStdin":false,"AttachStdout":false,"AttachStderr":false,"Tty":false,"OpenStdin":false,"StdinOnce":false,"Env":["PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"],"Cmd":["/bin/bash"],"Image":"","Volumes":null,"WorkingDir":"","Entrypoint":null,"OnBuild":null,"Labels":null},"Architecture":"","Os":"","Size":66626009,"VirtualSize":66626009,"GraphDriver":{"Data":null,"Name":""},"RootFS":{"Type":""},"Metadata":{"LastTagTime":"0001-01-01T00:00:00Z"}}

% sudo curl --unix-socket /run/podman/podman.sock http://d/v1.35/images/json

[{"Id":"2eb2d388e1a255c98029f40d6d7f8029fb13f1030abc8f11ccacbca686a8dc12","RepoTags":["docker.io/library/ubuntu:18.04"],"Created":"2020-07-24T14:38:22.027273323Z","Size":66626009,"Names":["docker.io/library/ubuntu:18.04"],"Digest":"sha256:a61728f6128fb4a7a20efaa7597607ed6e69973ee9b9123e3b4fd28b7bba100b","Digests":["sha256:a61728f6128fb4a7a20efaa7597607ed6e69973ee9b9123e3b4fd28b7bba100b","sha256:767eea1efb29ab7e215e1d97c8d758df5d587ca86e769a2dfb254c6b022895c3"],"History":["2eb2d388e1a255c98029f40d6d7f8029fb13f1030abc8f11ccacbca686a8dc12","\u003cmissing\u003e","\u003cmissing\u003e","\u003cmissing\u003e","\u003cmissing\u003e"]}]

Podman was installed from http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_20.04/ on Ubuntu 20.04

% sudo podman --version

podman version 2.0.4

@zhangguanzhang
Copy link
Collaborator

zhangguanzhang commented Aug 4, 2020

@max-arnold
Copy link

Thanks for the clarification! I'll try to build Podman from source, since packages are often lagging behind the releases...

@rhatdan
Copy link
Member

rhatdan commented Aug 4, 2020

@zhangguanzhang could you cherry pick this into the v2.0 release, then we know it will get into 2.0.5.

@mheon WIll be releasing 2.1 fairly soon, but getting this into the stable branch will have it show up RHEL8 and Centos 8.

@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 23, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
HTTP API Bug is in RESTful API kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

No branches or pull requests

8 participants