1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/graph
Vincent Batts 7795b1c697 graph: exported images times matching creation
the image export, that is used in `docker save` previous has just had
the layers times (atimes, mtimes) be when the save was done.
```bash
vbatts@valse ~ (master) $ docker save busybox | tar tv
drwxr-xr-x 0/0               0 2015-09-03 22:22 6ce2e90b0bc7224de3db1f0d646fe8e2c4dd37f1793928287f6074bc451a57ea/
-rw-r--r-- 0/0               3 2015-09-03 22:22 6ce2e90b0bc7224de3db1f0d646fe8e2c4dd37f1793928287f6074bc451a57ea/VERSION
-rw-r--r-- 0/0            1405 2015-09-03 22:22 6ce2e90b0bc7224de3db1f0d646fe8e2c4dd37f1793928287f6074bc451a57ea/json
-rw-r--r-- 0/0         2643968 2015-09-03 22:22 6ce2e90b0bc7224de3db1f0d646fe8e2c4dd37f1793928287f6074bc451a57ea/layer.tar
drwxr-xr-x 0/0               0 2015-09-03 22:22 8c2e06607696bd4afb3d03b687e361cc43cf8ec1a4a725bc96e39f05ba97dd55/
-rw-r--r-- 0/0               3 2015-09-03 22:22 8c2e06607696bd4afb3d03b687e361cc43cf8ec1a4a725bc96e39f05ba97dd55/VERSION
-rw-r--r-- 0/0            1346 2015-09-03 22:22 8c2e06607696bd4afb3d03b687e361cc43cf8ec1a4a725bc96e39f05ba97dd55/json
-rw-r--r-- 0/0            1024 2015-09-03 22:22 8c2e06607696bd4afb3d03b687e361cc43cf8ec1a4a725bc96e39f05ba97dd55/layer.tar
drwxr-xr-x 0/0               0 2015-09-03 22:22 cf2616975b4a3cba083ca99bc3f0bf25f5f528c3c52be1596b30f60b0b1c37ff/
-rw-r--r-- 0/0               3 2015-09-03 22:22 cf2616975b4a3cba083ca99bc3f0bf25f5f528c3c52be1596b30f60b0b1c37ff/VERSION
-rw-r--r-- 0/0            1181 2015-09-03 22:22 cf2616975b4a3cba083ca99bc3f0bf25f5f528c3c52be1596b30f60b0b1c37ff/json
-rw-r--r-- 0/0            1024 2015-09-03 22:22 cf2616975b4a3cba083ca99bc3f0bf25f5f528c3c52be1596b30f60b0b1c37ff/layer.tar
-rw-r--r-- 0/0              90 2015-09-03 22:22 repositories
```

With this change, the layer's directory and artifact will have times
matching the image layer's created time. The "repositories" file is set
to epoch.
```bash
vbatts@valse ~ (master) $ docker save busybox | tar tv
drwxr-xr-x 0/0               0 2015-04-17 18:01 6ce2e90b0bc7224de3db1f0d646fe8e2c4dd37f1793928287f6074bc451a57ea/
-rw-r--r-- 0/0               3 2015-04-17 18:01 6ce2e90b0bc7224de3db1f0d646fe8e2c4dd37f1793928287f6074bc451a57ea/VERSION
-rw-r--r-- 0/0            1405 2015-04-17 18:01 6ce2e90b0bc7224de3db1f0d646fe8e2c4dd37f1793928287f6074bc451a57ea/json
-rw-r--r-- 0/0         2643968 2015-04-17 18:01 6ce2e90b0bc7224de3db1f0d646fe8e2c4dd37f1793928287f6074bc451a57ea/layer.tar
drwxr-xr-x 0/0               0 2015-04-17 18:01 8c2e06607696bd4afb3d03b687e361cc43cf8ec1a4a725bc96e39f05ba97dd55/
-rw-r--r-- 0/0               3 2015-04-17 18:01 8c2e06607696bd4afb3d03b687e361cc43cf8ec1a4a725bc96e39f05ba97dd55/VERSION
-rw-r--r-- 0/0            1346 2015-04-17 18:01 8c2e06607696bd4afb3d03b687e361cc43cf8ec1a4a725bc96e39f05ba97dd55/json
-rw-r--r-- 0/0            1024 2015-04-17 18:01 8c2e06607696bd4afb3d03b687e361cc43cf8ec1a4a725bc96e39f05ba97dd55/layer.tar
drwxr-xr-x 0/0               0 2015-04-17 18:01 cf2616975b4a3cba083ca99bc3f0bf25f5f528c3c52be1596b30f60b0b1c37ff/
-rw-r--r-- 0/0               3 2015-04-17 18:01 cf2616975b4a3cba083ca99bc3f0bf25f5f528c3c52be1596b30f60b0b1c37ff/VERSION
-rw-r--r-- 0/0            1181 2015-04-17 18:01 cf2616975b4a3cba083ca99bc3f0bf25f5f528c3c52be1596b30f60b0b1c37ff/json
-rw-r--r-- 0/0            1024 2015-04-17 18:01 cf2616975b4a3cba083ca99bc3f0bf25f5f528c3c52be1596b30f60b0b1c37ff/layer.tar
-rw-r--r-- 0/0              90 1969-12-31 19:00 repositories
```

Side effect of this is that the tar stream from `docker save` is now
more deterministic.
```bash
vbatts@valse ~ (master) $ docker save busybox | sha1sum
baf03e30ef79ca4d9c5e512d3a1b873880f404ca  -
vbatts@valse ~ (master) $ docker save busybox | sha1sum
baf03e30ef79ca4d9c5e512d3a1b873880f404ca  -
vbatts@valse ~ (master) $ docker save busybox | sha1sum
baf03e30ef79ca4d9c5e512d3a1b873880f404ca  -
vbatts@valse ~ (master) $ docker save busybox | sha1sum
baf03e30ef79ca4d9c5e512d3a1b873880f404ca  -
```

Signed-off-by: Vincent Batts <vbatts@redhat.com>
2015-09-03 22:19:10 -04:00
..
tags /graph/tag fix lint errors/warnings 2015-08-05 17:46:41 +00:00
export.go graph: exported images times matching creation 2015-09-03 22:19:10 -04:00
graph.go [daemon] Refactor image_delete.go 2015-08-28 11:01:24 -07:00
graph_test.go Replace GenerateRandomID with GenerateNonCryptoID 2015-07-28 22:31:01 -07:00
history.go Documentation improvements and code cleanups for graph package 2015-07-30 14:27:10 -07:00
import.go adding message option to the import subcommand 2015-08-25 02:55:04 +00:00
list.go Fix #8048 : make docker images repository:tag work 2015-08-13 08:50:09 +02:00
load.go Clean up ProgressStatus 2015-08-27 13:22:08 -07:00
load_unsupported.go /graph fix lin errors/warnings 2015-07-29 20:59:36 +00:00
mutex.go Attempt to protect on disk image store with mutex 2015-06-25 20:16:37 -07:00
pools_test.go Clean up ProgressStatus 2015-08-27 13:22:08 -07:00
pull.go registry: Do not push to mirrors 2015-08-06 17:41:59 -04:00
pull_v1.go Remove "...already being pulled" messages 2015-08-27 13:22:08 -07:00
pull_v2.go Fix goroutine leak on pull 2015-08-31 15:56:19 -07:00
push.go Revert #14884 2015-08-12 18:46:48 -07:00
push_v1.go Change poolAdd to return a boolean instead of an error 2015-08-27 11:18:42 -07:00
push_v2.go Change poolAdd to return a boolean instead of an error 2015-08-27 11:18:42 -07:00
registry.go Documentation improvements and code cleanups for graph package 2015-07-30 14:27:10 -07:00
service.go graph: exported images times matching creation 2015-09-03 22:19:10 -04:00
tags.go Merge pull request #15489 from aaronlehmann/pull-updates 2015-08-31 09:37:33 -07:00
tags_unit_test.go Finish linting opts and trust package. 2015-08-27 17:36:11 +02:00