Commit Graph

286 Commits

Author SHA1 Message Date
35e8f92672 Remove dead code
Signed-off-by: Antonio Murdaca <runcom@linux.com>
Upstream-commit: 927d13bc3c2030bb0e0429dbc500f13d72e7ccf6
Component: engine
2015-06-20 19:14:15 +02:00
b387e8ade7 Merge pull request #13575 from mattmoor/consistent-push-fallback
Make v2 push have v1-fallback behavior consistent with pull.
Upstream-commit: d86345b9f722c187afd4af8a92583fc07506b5d9
Component: engine
2015-06-17 13:41:58 -07:00
0b8d2a4fe1 Merge pull request #13870 from lindenlab/pull-single-tag
Only request a single repository tag when pulling a specific image:tag
Upstream-commit: c107e9d7903d148692f9e727bf6d5ce6e88e2f72
Component: engine
2015-06-17 15:29:39 -04:00
2d2c80b6fc Merge pull request #13975 from stevvooe/move-setup-init-layer
Move graph.SetupInitLayer to daemon package where it is used
Upstream-commit: a27d8f9aa4dbdbad5bbfd83c8d8321e7a976305c
Component: engine
2015-06-16 22:37:51 -04:00
fe0ca49e61 Move graph.SetupInitLayer to daemon package where it is used
An inspection of the graph package showed this function to be way out of place.
It is only depended upon by the daemon code. The function prepares a top-level
readonly layer used to provide a consistent runtime environment for docker
images.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
Upstream-commit: b7f887a9a24a2df61fa53612ae42b7e9d62fe858
Component: engine
2015-06-16 16:50:56 -07:00
d527901687 Merge pull request #13685 from yuchangchun1/tag_regx
add a more accurate error description for invalid tag name
Upstream-commit: ba9db62e68581b2f9187b15b13150396961e23e9
Component: engine
2015-06-16 16:33:17 -07:00
8810db85be Merge pull request #13198 from rhvgoyal/extend-docker-inspect
docker-inspect: Extend docker inspect to export image metadata related to graph driver
Upstream-commit: e69df2589c1220217054abdc6a361b55990b3c0b
Component: engine
2015-06-16 15:03:14 -05:00
4dbf1e0f71 Only pulling single repository tag on pull for a specific tag. extending TestGetRemoteTags unit test
Splitting out GetRemoteTag from GetRemoteTags.  Adding registry.ErrRepoNotFound error

Signed-off-by: Don Kjer <don.kjer@gmail.com>
Upstream-commit: b349a74c71fb072f9f23f508b8c698d0590abb12
Component: engine
2015-06-16 07:10:09 +00:00
778f11fd97 Store layer digests on pull
Currently digests are not stored on pull, causing a simple re-tag or re-push to send up all layers. Storing the digests on pull will allow subsequent pushes to the same repository to not push up content.
This does not address pushing content to a new repository. When content is pushed to a new repository, the digest will be recalculated. Since only one digest is currently stored, it may cause a new content push to the original repository.

Fixes #13883

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: a98ea87e463383a77d7244c78c9da3ac9f2cd086
Component: engine
2015-06-15 11:08:21 -07:00
4a6f8e2e63 docker-inspect: Extend docker inspect to export image/container metadata related to graph driver
Export image/container metadata stored in graph driver. Right now 3 fields
DeviceId, DeviceSize and DeviceName are being exported from devicemapper.
Other graph drivers can export fields as they see fit.

This data can be used to mount the thin device outside of docker and tools
can look into image/container and do some kind of inspection.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: 407a626be62996cd6385ea4d80e669ab83f5f04d
Component: engine
2015-06-15 14:05:10 -04:00
3e78e2ecb7 Merge pull request #13773 from dmcgowan/refactor-1-image-graph-separation
refactor: separate graph from image
Upstream-commit: 00b8fec75f3a113c851013e0f0d559cc6d96b84d
Component: engine
2015-06-11 17:44:37 -07:00
08db54d962 Show actual number of elements restored
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 141cd2a1f26f3455a1daf20420ca1efb5a9e1a16
Component: engine
2015-06-10 15:18:51 -07:00
c2f09cc42b Update graph to use digest type
Update get and set functions to use digests.
Update push code to use the digest type instead of string

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: c0b44218196ab597d22eb6344e8770fdee73067b
Component: engine
2015-06-05 18:07:41 -07:00
6c407af390 Update graph walkhistory to pass by value
Remove unused graph history function

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: bb50a4159bda8e6f2d47b69ddd476ab32ac6be14
Component: engine
2015-06-05 18:06:09 -07:00
6825ac1c62 Separate graph from image
Move graph related functions in image to graph package.
Consolidating graph functionality is the first step in refactoring graph into an image store model.
Subsequent refactors will involve breaking up graph into multiple types with a strongly defined interface.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 2b58b677a54950bc78c13760ef79fe6284154847
Component: engine
2015-06-05 18:06:09 -07:00
edbdadf562 Make the v2 logic fallback on v1 when v2 requests cannot be authorized.
Signed-off-by: Matt Moore <mattmoor@google.com>
Upstream-commit: bd2575cc4f16bdce1748e90bdef63823cff3a35d
Component: engine
2015-06-02 21:22:59 -07:00
0cd5e0e48f add a more accurate error description for invalid tag name
Signed-off-by: yuchangchun <yuchangchun1@huawei.com>
Upstream-commit: e0475d331ba59bb742903e6a1b88251b9b27f416
Component: engine
2015-06-03 09:38:39 +08:00
49338919a2 Merge pull request #13576 from stevvooe/verify-digests
Properly verify manifests and layer digests on pull
Upstream-commit: 274baf70bf806678d12adc1e1de2c8d7774de645
Component: engine
2015-06-02 11:16:23 -07:00
8ce2553351 If no endpoint could be established with the given mirror configuration,
fallback to pulling from the hub as per v1 behavior.

Signed-off-by: Richard Scothern <richard.scothern@gmail.com>
Upstream-commit: 6e4ff1bb13c82fd530b27c85ae9b0ca476cddfcd
Component: engine
2015-06-01 15:18:56 -07:00
e03ebf99d3 Break down loadManifest function into constituent parts
Signed-off-by: Stephen J Day <stephen.day@docker.com>
Upstream-commit: 84413be3c9f908c08f79e3080d9a74fb8ad34505
Component: engine
2015-06-01 13:02:50 -07:00
882b9f99a2 Add tests for loadManifest digest verification
Signed-off-by: Stephen J Day <stephen.day@docker.com>
Upstream-commit: 74528be903d2f6c9e07ab9a3931b050d5dae6562
Component: engine
2015-05-29 16:30:21 -07:00
412d1581d2 Attempt to retain tagging behavior
Signed-off-by: Stephen J Day <stephen.day@docker.com>
Upstream-commit: 1e653ab645b513966c3fe9b13db7a5a9c9a8acb7
Component: engine
2015-05-29 15:20:37 -07:00
395ceacd61 Properly verify manifests and layer digests on pull
To ensure manifest integrity when pulling by digest, this changeset ensures
that not only the remote digest provided by the registry is verified but also
that the digest provided on the command line is checked, as well. If this check
fails, the pull is cancelled as with an error. Inspection also should that
while layers were being verified against their digests, the error was being
treated as tech preview image signing verification error. This, in fact, is not
a tech preview and opens up the docker daemon to man in the middle attacks that
can be avoided with the v2 registry protocol.

As a matter of cleanliness, the digest package from the distribution project
has been updated to latest version. There were some recent improvements in the
digest package.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
Upstream-commit: 06612cc0fee103bf6f46429e3cd572725ef72948
Component: engine
2015-05-29 15:20:28 -07:00
553a8c069a Merge pull request #13374 from RichardScothern/v2-mirror
V2 mirror support
Upstream-commit: 2daede5a9cc6cc171f2f1f3aebcae561a2421d18
Component: engine
2015-05-27 21:15:26 -04:00
430d1ade67 Review feedback:
- Match verbiage with other output
    - Remove dead code and clearer flow

Signed-off-by: Richard Scothern <richard.scothern@gmail.com>
Upstream-commit: e817e08481b91638037e55b8d4855f56814c81f5
Component: engine
2015-05-27 17:29:24 -07:00
f4eb0aeb64 Restore the stripped registry version number
Signed-off-by: Richard Scothern <richard.scothern@gmail.com>
Upstream-commit: f6f7d3524862563f8388e1382bb28ecbde8cf265
Component: engine
2015-05-27 15:15:47 -07:00
b58daceb88 Merge pull request #12881 from nakedible/patch-1
Prevent fallback to v1 registry for digest pulls
Upstream-commit: 54b514735c592de77f3d79ec80c2d37bd589da6c
Component: engine
2015-05-26 19:24:37 -04:00
416a489d28 Allow mirroring only for the official index
Strip authconfig from session to keep credentials from being sent to the mirror.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: c19962ade10619e5edd8057249566c494d4719bb
Component: engine
2015-05-26 11:08:19 -07:00
521590a1df Registry v2 mirror support.
The v2 registry will act as a pull-through cache, and needs to be
handled differently by the client to the v1 registry mirror.

See docker/distribution#459 for details

Configuration

Only one v2 registry can be configured as a mirror. Acceptable configurations
in this chanage are: 0...n v1 mirrors or 1 v2 mirror. A mixture of v1 and v2
mirrors is considered an error.

Pull

If a v2 mirror is configured, all pulls are redirected to that mirror. The
mirror will serve the content locally or attempt a pull from the upstream mirror,
cache it locally, and then serve to the client.

Push

If an image is tagged to a mirror, it will be pushed to the mirror and be
stored locally there. Otherwise, images are pushed to the hub. This is
unchanged behavior.

Signed-off-by: Richard Scothern <richard.scothern@gmail.com>
Upstream-commit: 13deed380127d4a0e7982bb0d4f6529d0962116b
Component: engine
2015-05-26 11:08:19 -07:00
04b3252768 Add transport package to support CancelRequest
Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: 73823e5e56446b23ce01bb8e44a9670ab2552b0a
Component: engine
2015-05-18 23:31:42 -04:00
14d2347fac registry: Refactor requestfactory to use http.RoundTrippers
This patch removes the need for requestFactories and decorators
by implementing http.RoundTripper transports instead.

It refactors some challenging-to-read code.

NewSession now takes an *http.Client that can already have a
custom Transport, it will add its own auth transport by wrapping
it.

The idea is that callers of http.Client should not bother
setting custom headers for every handler but instead it should
be transparent to the callers of a same context.

This patch is needed for future refactorings of registry,
namely refactoring of the v1 client code.

Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: a01cc3ca7729c3ce635fef7c1db837b5c6ae1028
Component: engine
2015-05-18 21:51:53 -04:00
acd82df11a Prevent fallback to v1 registry for digest pulls
The intention of the user is to download a verified image if explicitly
pulling with a digest and falling back to v1 registry circumvents that
protection.

Signed-off-by: Nuutti Kotivuori <naked@iki.fi>
Upstream-commit: 642e6a377324c7873f278c6bd7fd5e60201139e2
Component: engine
2015-05-18 08:26:26 +03:00
56ea157723 Revert "Fix inconsistent date formats in API"
This reverts commit 945fc9d882324ac87505e34bb74e6ebe30be1309.

Signed-off-by: Victor Vieux <victorvieux@gmail.com>
Upstream-commit: b261ce5fb007371892bc40a5853337db09a1c8ae
Component: engine
2015-05-14 17:31:45 -07:00
2e9a18b752 Fix inconsistent date formats in API
Prior to this patch, the response of
- GET /images/json
- GET /containers/json
- GET /images/(name)/history

display the Created Time as UNIX format which doesn't make sense.

These should be more readable as CLI command `docker inspect` shows.

Due to the case that an older client with a newer version daemon, we
need the version check for now.

Signed-off-by: Hu Keping <hukeping@huawei.com>
Upstream-commit: 945fc9d882324ac87505e34bb74e6ebe30be1309
Component: engine
2015-05-14 18:58:55 +08:00
71c213ec0b Merge pull request #13131 from Microsoft/10662-loadonwindows
Windows: Build load.go
Upstream-commit: 3985f1781228d6060228d83e559f14e6d7cc9d7c
Component: engine
2015-05-12 18:04:33 -07:00
aeecef0f70 Refactor pkg/stremformatter with custom constructors instead of passing a boolean
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: 6b700bdacae0b416d8239a0a24729fe327d425d1
Component: engine
2015-05-13 00:09:41 +02:00
aaf186c8e8 Windows: Build load.go
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: aed8f9f76e16ed7acc49fbdef5f4563834ac5167
Component: engine
2015-05-12 14:26:57 -07:00
4a0ddadbc0 Remove API codepaths < 1.12
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: 7284b08204fb85838170bdf82e2c379e1a4713c9
Component: engine
2015-05-12 20:09:49 +02:00
a9af2bce60 Move WriteFlusher out of utils into ioutils
Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
Upstream-commit: 223d6de728ac5df5394b4990f81a466c858d519c
Component: engine
2015-05-08 12:33:33 -06:00
d482451b94 Merge pull request #12270 from burnison/11294-shortidfallback
Only use fallback to short IDs when obvious.
Upstream-commit: f6fa579d52a446d6a8171330ddad73602c79dd30
Component: engine
2015-05-07 17:02:58 -07:00
5a7855d50e Merge pull request #12976 from Microsoft/10662-graphfirstchange
Windows: First fix for graph\graph.go
Upstream-commit: d34abea15b1e82c6c1b8a3dc8ab23097a6dae953
Component: engine
2015-05-07 16:50:20 -07:00
a555add607 Merge pull request #13059 from burke/no-fsync-on-temp-archive
Remove fsync in archive.NewTempArchive
Upstream-commit: 237bd23af85dc2624e973534bca1caa8741ab8f6
Component: engine
2015-05-07 16:16:52 -07:00
4d8c51b323 Don't fsync on V2 registry push tempfile creation
Signed-off-by: Burke Libbey <burke.libbey@shopify.com>
Upstream-commit: ec66daebc2087b9bab832c973f1bd7f8a6d1a5f4
Component: engine
2015-05-07 14:49:38 -04:00
61b5e9a5f1 Merge pull request #12977 from Microsoft/10662-graphloadfilepath
Windows: Filepath in graph\load.go
Upstream-commit: 7d38d33f018a96bde5d08ae09628d4444b0aee26
Component: engine
2015-05-06 15:01:49 -07:00
a78ec5ccea Merge pull request #12975 from Microsoft/10662-graphexportfilepath
Windows: graph\export.go filepath fixes
Upstream-commit: a242ceaa0967a72dee55ef6a2cec05c78526d33c
Component: engine
2015-05-05 21:44:57 -04:00
d33c276cc3 Windows: Fix filepath vs path in push.go
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 3b2c8f69fd7f1ca6a463b9bd2c2e006d9e13fe98
Component: engine
2015-05-04 16:18:23 -07:00
1195e97bff Windows: Filepath in graph\load.go
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: bb1ecde1648220871bbf627b8a844fc8501163ba
Component: engine
2015-05-04 15:14:39 -07:00
2a741d7980 Windows: First fix for graph\graph.go
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: b30f14f06d3a6c289257cf29d2e967ba09900a1e
Component: engine
2015-05-04 15:06:51 -07:00
e1e136fe26 Windows: graph\export.go filepath fixes
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 377ed712d38e75d24ebfe2b5b91455a77bf8b086
Component: engine
2015-05-04 14:56:23 -07:00
7bd38d02c2 Finally remove our copy of "archive/tar" now that Go 1.4 is the minimum!
IT'S ABOUT TIME. 🎉

Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
Upstream-commit: 576985a1dcd76a9af2c5c483e6f12035a1f47b96
Component: engine
2015-05-01 16:01:10 -06:00