Skip to content

Update remote scraping to grab "last modified" date for foreign layers #17

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

Merged
merged 1 commit into from
Oct 26, 2017

Conversation

tianon
Copy link
Member

@tianon tianon commented Oct 26, 2017

Here's an example diff for hello-world:

diff --git a/repos/hello-world/tag-details.md b/repos/hello-world/tag-details.md
index 551670458..41e5cfcd1 100644
--- a/repos/hello-world/tag-details.md
+++ b/repos/hello-world/tag-details.md
@@ -231,9 +231,11 @@ RUN cmd /S /C #(nop)  CMD ["cmd" "/C" "type C:\\hello.txt"]

 -	Layers:
 	-	`sha256:bce2fbc256ea437a87dadac2f69aabd25bed4f56255549090056c1131fad0277`
+		Last Modified: Tue, 13 Dec 2016 10:47:17 GMT
 		Size: 252.7 MB (252691002 bytes)
 		MIME: application/vnd.docker.image.rootfs.foreign.diff.tar.gzip
 	-	`sha256:b0b5e40cb939a7befa4e01212d6f65f30022bbd04b5f15985b45ce9cfd3fcabc`
+		Last Modified: Mon, 09 Oct 2017 19:23:15 GMT
 		Size: 141.8 MB (141758132 bytes)
 		MIME: application/vnd.docker.image.rootfs.foreign.diff.tar.gzip
 	-	`sha256:87377cdc7dd13b955024f290de8aa6606f7ce958a72091495e3c258c800bdaf5`
@@ -479,9 +481,11 @@ RUN cmd /S /C #(nop)  CMD ["cmd" "/C" "type C:\\hello.txt"]

 -	Layers:
 	-	`sha256:bce2fbc256ea437a87dadac2f69aabd25bed4f56255549090056c1131fad0277`
+		Last Modified: Tue, 13 Dec 2016 10:47:17 GMT
 		Size: 252.7 MB (252691002 bytes)
 		MIME: application/vnd.docker.image.rootfs.foreign.diff.tar.gzip
 	-	`sha256:b0b5e40cb939a7befa4e01212d6f65f30022bbd04b5f15985b45ce9cfd3fcabc`
+		Last Modified: Mon, 09 Oct 2017 19:23:15 GMT
 		Size: 141.8 MB (141758132 bytes)
 		MIME: application/vnd.docker.image.rootfs.foreign.diff.tar.gzip
 	-	`sha256:87377cdc7dd13b955024f290de8aa6606f7ce958a72091495e3c258c800bdaf5`

@tianon
Copy link
Member Author

tianon commented Oct 26, 2017

Here's what an example manifest looks like for these foreign layers:

{
   "schemaVersion": 2,
   "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
   "config": {
      "mediaType": "application/vnd.docker.container.image.v1+json",
      "size": 1853,
      "digest": "sha256:64cd2c7dc23a8ac2258f081d6fb3858debdd178341ab8d51ef8acc622127b6fd"
   },
   "layers": [
      {
         "mediaType": "application/vnd.docker.image.rootfs.foreign.diff.tar.gzip",
         "size": 252691002,
         "digest": "sha256:bce2fbc256ea437a87dadac2f69aabd25bed4f56255549090056c1131fad0277",
         "urls": [
            "https://go.microsoft.com/fwlink/?linkid=837858"
         ]
      },
      {
         "mediaType": "application/vnd.docker.image.rootfs.foreign.diff.tar.gzip",
         "size": 141758132,
         "digest": "sha256:b0b5e40cb939a7befa4e01212d6f65f30022bbd04b5f15985b45ce9cfd3fcabc",
         "urls": [
            "https://go.microsoft.com/fwlink/?linkid=860052"
         ]
      },
      {
         "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
         "size": 1660,
         "digest": "sha256:87377cdc7dd13b955024f290de8aa6606f7ce958a72091495e3c258c800bdaf5"
      },
      {
         "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
         "size": 958,
         "digest": "sha256:7d840042f15f5e431f1d62b2337774f2a41dfe0303c87fce3692fecc998a4f87"
      }
   ]
}

(from winamd64/hello-world:nanoserver@sha256:6168e1e1f8cd1388c34aa53e1095cb6f1e51960f27e9b091e7160b70591fac21)

@yosifkit yosifkit merged commit f45e56f into docker-library:master Oct 26, 2017
@yosifkit yosifkit deleted the foreign-last-modified branch October 26, 2017 19:11
@tianon
Copy link
Member Author

tianon commented Oct 26, 2017

So neat:

$ curl -fsSL 'https://go.microsoft.com/fwlink/?linkid=837858' | sha256sum
bce2fbc256ea437a87dadac2f69aabd25bed4f56255549090056c1131fad0277  -

From the JSON above:

      {
         "mediaType": "application/vnd.docker.image.rootfs.foreign.diff.tar.gzip",
         "size": 252691002,
         "digest": "sha256:bce2fbc256ea437a87dadac2f69aabd25bed4f56255549090056c1131fad0277",
         "urls": [
            "https://go.microsoft.com/fwlink/?linkid=837858"
         ]
      },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants