Commit Graph

101 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
954f940156 Small if err cleaning
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: 844538142d95c1b7dda1bb2903179510105fe9b5
Component: engine
2015-04-27 21:50:33 +02:00
88eea81abe Merge pull request #12655 from jlhawn/fix_12281
Validate repo name before image pull
Upstream-commit: 68fc79f5924bc76111422eec5b7713a586febd96
Component: engine
2015-04-23 13:12:12 -07:00
8cb2465efc 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)
Upstream-commit: 18f46883851e47387ec2bd116940cdae97ba3c8d
Component: engine
2015-04-23 11:44:46 -07:00
c8f1332dce 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>
Upstream-commit: bb9da6ba9294a8eab8f4dfaf7cf07c57959fe608
Component: engine
2015-04-23 10:18:38 -07:00
43e79cc411 Remove chain of engine passing from builder to loadManifest
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: a2f74aa4b449479dc3953b129c839ca90b089494
Component: engine
2015-04-21 14:55:23 -07:00
0790d1610c Remove engine from trust
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 9e50bf6270f426f6ef6649b1985036988b207407
Component: engine
2015-04-20 12:48:33 -07:00
14bae8f05b Merge pull request #12358 from ZJU-SEL/remove_job_from_tag
remove job from tag
Upstream-commit: b1d8ae3824d2902c86d63837b8d413952b546d62
Component: engine
2015-04-19 16:02:28 -04:00
dd5f4141fe remove job from tag
Signed-off-by: Simei He <hesimei@zju.edu.cn>
Upstream-commit: 99f6309b97041bf82cc845340734dc8e47977c8a
Component: engine
2015-04-19 18:36:56 +08:00
0ff275f7b4 remove job from pull and import
Closes #12396

Signed-off-by: Simei He <hesimei@zju.edu.cn>

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 6e38a53f96403b4cbd38e49e6b294128ed054a20
Component: engine
2015-04-17 09:55:02 -07:00
f10bd173bd Merge pull request #11478 from dmcgowan/v2-vendored-api
Use v2 api from distribution
Upstream-commit: 563041b5c4acaca8e6ebb8fb4e81a3e7e7c37e81
Component: engine
2015-04-10 17:22:38 -04:00
0d3afdf0c8 Remove engine usage for events
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: c9eb37f9752d72d9a4280d703368e5e73adfffa1
Component: engine
2015-04-07 08:43:18 -07:00
753b8ae08c Remove jobs from registry.Service
This makes `registry.Service` a first class type and does not use jobs
to interact with this type.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 03d3d79b2b3f8b720fff2d649aff0ef791cff417
Component: engine
2015-03-31 16:38:04 -07:00
fc0b67bcbc Use vendored v2 registry api
Update registry package to use the v2 registry api from distribution. Update interfaces to directly take in digests.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 62009ef77efcbe30afea0cd124f3fbff0d5030cd
Component: engine
2015-03-31 15:02:27 -07:00
1c9316a817 Merge pull request #11788 from reikani/pchoi
Changed snake case naming to camelCase.
Upstream-commit: da5c863d20df8c030b3ffc6c4e95f976ed162721
Component: engine
2015-03-26 23:55:50 -07:00
29d7b5b844 Merge pull request #11841 from runcom/11762-replace-aliased-logrus-imports
Replace aliased imports of logrus
Upstream-commit: 756b8f2fde210da5529e0a5480e149917ab25524
Component: engine
2015-03-26 16:49:01 -07:00
e5b36a723c Replace aliased imports of logrus, fixes #11762
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: 6f4d847046cb4e072de61d042c0266190d73a8c9
Component: engine
2015-03-26 23:22:04 +01:00
0913f2905d Changed snake case naming to camelCase
Signed-off-by: Peter Choi <phkchoi89@gmail.com>
Upstream-commit: ae907e7af16136225417242ef5d55d3f6062fb3b
Component: engine
2015-03-26 15:05:45 -06:00
ed7e44e788 Consider tag updated also in case repo does not exist
This patch causes `The image you are pulling has been verified` status
message to be produced also when the repository is pulled for the first
time.

Signed-off-by: Michal Minar <miminar@redhat.com>
Upstream-commit: 3b8d4bb82ba6abf728cd40c838bfd665f8d10639
Component: engine
2015-03-26 12:52:56 +01:00
0ee1e9f604 Fixes hacks from progressreader refactor
related to #10959

Signed-off-by: bobby abbott <ttobbaybbob@gmail.com>
Upstream-commit: 0cd6c05d8112e9246b734107d54e2855e3d5fec5
Component: engine
2015-03-25 18:21:02 -07:00
a16f3d6cb4 Remove engine.Status and replace it with standard go error
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: c79b9bab541673af121d829ebc3b29ff1b01efa2
Component: engine
2015-03-25 22:32:08 +01:00
1e47557825 Refactor pkg/common, Fixes #11599
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: b80fae735684406d848b16a0f148a746e17ed25f
Component: engine
2015-03-24 18:19:59 +01:00
919e9683e3 Enable v2 default push
When pushing to the official registry, v2 push will be attempted first. If the v2 endpoint is unavailable, a push to v1 will occur. If a v2 push is started and failed, the push operation will fail. Pulling non-official images the official v2 registry is also enabled to pull the newly push images. When a pull of a v2 image fails, v1 will always be attempted.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 770e9b6b819b495a933b2f467bf768a1b785d5ad
Component: engine
2015-03-20 11:09:33 -07:00
54c09d3930 Add verification of image manifest digests
Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
Upstream-commit: 9ececa14ba860c9934d3cd8d3e704e53e828e22b
Component: engine
2015-03-20 09:34:39 -07:00
3105d32a23 Support push and pull of sha256
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 514be385f7451df8bbf9e1a7bb015e3baec406f1
Component: engine
2015-03-17 10:50:35 -07:00
d6d379e87a Add ability to refer to image by name + digest
Add ability to refer to an image by repository name and digest using the
format repository@digest. Works for pull, push, run, build, and rmi.

Signed-off-by: Andy Goldstein <agoldste@redhat.com>
Upstream-commit: a2b0c9778feac970524b98ef7a91b5528fdeb9d5
Component: engine
2015-03-17 10:10:42 +00:00
eda2d7f6c9 Merge pull request #11419 from dmcgowan/fix-test-pull-verified
Fix test pull verified
Upstream-commit: 2550c306eb737c75f331454fa372bc5700b566f4
Component: engine
2015-03-16 14:23:59 -07:00
f32b25fee3 Fix test pull verified
Update pull code to consider any layer download or new tag as an update.
Update hello-world frozen image to be explicitly tagged as frozen, to not interfere with pull tests.  The hello-world is used by pull tests because of its small size and there is no other official image with such a size.

fixes #11383

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 636037c3637eb1d09cc469cebe39ffb915bb0aa9
Component: engine
2015-03-16 12:22:00 -07:00
6283bdf158 Remove import to utils in progressreader
Added method in StreamFormatter to handle calls
from progressreader. Solves #10959

Signed-off-by: bobby abbott <ttobbaybbob@gmail.com>
Upstream-commit: 12b278d3540bc32699e8c2197b556188fd98b77b
Component: engine
2015-03-11 00:50:27 -07:00
1d55bf7466 Check for error when copying v2 image blob to temp
The call to io.Copy was not being checked for errors at a critical point in the
pull logic. This patch will log the error value if not nil.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
Upstream-commit: 6564e0ad2f63257458a5bad68f47504223b00285
Component: engine
2015-03-06 18:03:39 -08:00
bdb65abebf Removing dependencies from pkg into Docker internal code
Closes #10922

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
Upstream-commit: 7a9c944b827dc0cd416d701fe6460264f05166bb
Component: engine
2015-02-23 18:43:10 +00:00