Commit graph

372 commits

Author SHA1 Message Date
Derek McGowan
2b58b677a5 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)
2015-06-05 18:06:09 -07:00
Matt Moore
bd2575cc4f Make the v2 logic fallback on v1 when v2 requests cannot be authorized.
Signed-off-by: Matt Moore <mattmoor@google.com>
2015-06-02 21:22:59 -07:00
yuchangchun
e0475d331b add a more accurate error description for invalid tag name
Signed-off-by: yuchangchun <yuchangchun1@huawei.com>
2015-06-03 09:38:39 +08:00
Arnaud Porterie
274baf70bf Merge pull request #13576 from stevvooe/verify-digests
Properly verify manifests and layer digests on pull
2015-06-02 11:16:23 -07:00
Richard
6e4ff1bb13 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>
2015-06-01 15:18:56 -07:00
Stephen J Day
84413be3c9 Break down loadManifest function into constituent parts
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2015-06-01 13:02:50 -07:00
Stephen J Day
74528be903 Add tests for loadManifest digest verification
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2015-05-29 16:30:21 -07:00
Stephen J Day
1e653ab645 Attempt to retain tagging behavior
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2015-05-29 15:20:37 -07:00
Stephen J Day
06612cc0fe 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>
2015-05-29 15:20:28 -07:00
Tibor Vass
2daede5a9c Merge pull request #13374 from RichardScothern/v2-mirror
V2 mirror support
2015-05-27 21:15:26 -04:00
Richard
e817e08481 Review feedback:
- Match verbiage with other output
    - Remove dead code and clearer flow

Signed-off-by: Richard Scothern <richard.scothern@gmail.com>
2015-05-27 17:29:24 -07:00
Richard
f6f7d35248 Restore the stripped registry version number
Signed-off-by: Richard Scothern <richard.scothern@gmail.com>
2015-05-27 15:15:47 -07:00
Tibor Vass
54b514735c Merge pull request #12881 from nakedible/patch-1
Prevent fallback to v1 registry for digest pulls
2015-05-26 19:24:37 -04:00
Derek McGowan
c19962ade1 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)
2015-05-26 11:08:19 -07:00
Richard
13deed3801 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>
2015-05-26 11:08:19 -07:00
Tibor Vass
73823e5e56 Add transport package to support CancelRequest
Signed-off-by: Tibor Vass <tibor@docker.com>
2015-05-18 23:31:42 -04:00
Tibor Vass
a01cc3ca77 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>
2015-05-18 21:51:53 -04:00
Nuutti Kotivuori
642e6a3773 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>
2015-05-18 08:26:26 +03:00
Victor Vieux
b261ce5fb0 Revert "Fix inconsistent date formats in API"
This reverts commit 945fc9d882.

Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2015-05-14 17:31:45 -07:00
Hu Keping
945fc9d882 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>
2015-05-14 18:58:55 +08:00
Tibor Vass
3985f17812 Merge pull request #13131 from Microsoft/10662-loadonwindows
Windows: Build load.go
2015-05-12 18:04:33 -07:00
Antonio Murdaca
6b700bdaca Refactor pkg/stremformatter with custom constructors instead of passing a boolean
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-05-13 00:09:41 +02:00
John Howard
aed8f9f76e Windows: Build load.go
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-05-12 14:26:57 -07:00
Antonio Murdaca
7284b08204 Remove API codepaths < 1.12
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-05-12 20:09:49 +02:00
Tianon Gravi
223d6de728 Move WriteFlusher out of utils into ioutils
Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
2015-05-08 12:33:33 -06:00
Jessie Frazelle
f6fa579d52 Merge pull request #12270 from burnison/11294-shortidfallback
Only use fallback to short IDs when obvious.
2015-05-07 17:02:58 -07:00
Jessie Frazelle
d34abea15b Merge pull request #12976 from Microsoft/10662-graphfirstchange
Windows: First fix for graph\graph.go
2015-05-07 16:50:20 -07:00
Jessie Frazelle
237bd23af8 Merge pull request #13059 from burke/no-fsync-on-temp-archive
Remove fsync in archive.NewTempArchive
2015-05-07 16:16:52 -07:00
Burke Libbey
ec66daebc2
Don't fsync on V2 registry push tempfile creation
Signed-off-by: Burke Libbey <burke.libbey@shopify.com>
2015-05-07 14:49:38 -04:00
Alexander Morozov
7d38d33f01 Merge pull request #12977 from Microsoft/10662-graphloadfilepath
Windows: Filepath in graph\load.go
2015-05-06 15:01:49 -07:00
Brian Goff
a242ceaa09 Merge pull request #12975 from Microsoft/10662-graphexportfilepath
Windows: graph\export.go filepath fixes
2015-05-05 21:44:57 -04:00
John Howard
3b2c8f69fd Windows: Fix filepath vs path in push.go
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-05-04 16:18:23 -07:00
John Howard
bb1ecde164 Windows: Filepath in graph\load.go
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-05-04 15:14:39 -07:00
John Howard
b30f14f06d Windows: First fix for graph\graph.go
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-05-04 15:06:51 -07:00
John Howard
377ed712d3 Windows: graph\export.go filepath fixes
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-05-04 14:56:23 -07:00
Tianon Gravi
576985a1dc 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>
2015-05-01 16:01:10 -06:00
Antonio Murdaca
844538142d Small if err cleaning
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-27 21:50:33 +02:00
Jessie Frazelle
531ec3cac9 Merge pull request #12532 from ankushagarwal/eliminate-json-marshal
Eliminate json.Marshal from graph/export.go and volumes/volume.go
2015-04-27 13:54:20 -05:00
Antonio Murdaca
26543e0309 Replace json.Unmarshal with json.Decoder().Decode()
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-26 15:02:01 +02:00
Ankush Agarwal
29a3bbf2b3 Eliminate json.Marshal from graph/export.go and volumes/volume.go
Fixes #12531
Fixes #12530

Signed-off-by: Ankush Agarwal <ankushagarwal11@gmail.com>
2015-04-24 15:40:21 -07:00
Antonio Murdaca
fa2c68a89e Remove engine/job from graph
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-23 23:36:29 +02:00
Jessie Frazelle
68fc79f592 Merge pull request #12655 from jlhawn/fix_12281
Validate repo name before image pull
2015-04-23 13:12:12 -07:00
Alexander Morozov
9ed5bfb083 Merge pull request #12636 from duglin/MoveConfig
Move CLI config processing out from under registry dir
2015-04-23 11:50:31 -07:00
Josh Hawn
18f4688385 Validate repo name before image pull
Checks for reserved 'scratch' image name.

fixes #12281

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
2015-04-23 11:44:46 -07:00
Simei He
2a14b7dd35 remove job from image_export
Signed-off-by: He Simei <hesimei@zju.edu.cn>
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-04-23 10:54:25 -07:00
Doug Davis
bb9da6ba92 Move CLI config processing out from under registry dir
No logic changes should be in here, just moving things around.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-04-23 10:18:38 -07:00
Simei He
d456401fe1 remove job from push
Signed-off-by: Simei He <hesimei@zju.edu.cn>

Signed-off-by: He Simei <hesimei@zju.edu.cn>
2015-04-23 21:21:56 +08:00
Simei He
70bb0d8ed7 remove job from load
Signed-off-by: Simei He <hesimei@zju.edu.cn>

Signed-off-by: He Simei <hesimei@zju.edu.cn>
2015-04-23 19:13:12 +08:00
Brian Goff
ccbb93e1cd Merge pull request #12611 from LK4D4/remove_eng_chain_pull
Remove chain of engine passing from builder to loadManifest
2015-04-21 19:19:56 -04:00
Alexander Morozov
a2f74aa4b4 Remove chain of engine passing from builder to loadManifest
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-04-21 14:55:23 -07:00