Commit Graph

208 Commits

Author SHA1 Message Date
86e27c99e0 Merge pull request #31720 from jonjohnsonjr/always-head
Always HEAD blobs at least once during pushes
Upstream-commit: 4261687d787d07c2b00985e6517e23d3ce2e01dd
Component: engine
2017-03-16 14:39:02 +01:00
6079289459 Merge pull request #30047 from duglin/distError
Add the mediaType to the error
Upstream-commit: e10f9db26d7db8396d6f70419ecd1aa081190069
Component: engine
2017-03-10 16:44:49 -08:00
aa68ffe980 Always HEAD blobs at least once during pushes
Signed-off-by: Jon Johnson <jonjohnson@google.com>
Upstream-commit: cdc46abde53a8728affff2b39255dce6410fb6b8
Component: engine
2017-03-08 15:36:12 -08:00
47709fd338 Merge pull request #31083 from xulike666/fight-for-readability
fix some typos from module contrib to man
Upstream-commit: 57fd478169071b09f0e6657cc1c2568d80c1bed3
Component: engine
2017-03-03 15:13:01 +01:00
122308775b Merge pull request #30888 from estesp/moar-manifestlist-debug-output
Add debug output to manifest list parsing
Upstream-commit: 91f11437b6d62a753d68a4291fc68ecd0c029ee1
Component: engine
2017-03-03 13:09:38 +09:00
e5361f1d31 Add the mediaType to the error
Without this fix the error the client might see is:
	target is unknown
which wasn't helpful to me when I saw this today. With this fix I
now see:
	MediaType is unknown: 'text/html'
which helped me track down the issue to the registry I was talking to.

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: c127d9614f5b30bd73861877f8540a63e7d869e9
Component: engine
2017-02-28 11:36:32 -08:00
ff7af857c1 Add debug output to manifest list parsing
Per request for more debug info on how the engine deals with
multi-platform "manifest list" images, this adds information about the
manifest list entries and whether it found an os/arch match, and the
digest of the match.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
Upstream-commit: 9a8cb9313c9c5eb535cf0bce25ca27f84bbfc570
Component: engine
2017-02-28 14:11:13 -05:00
722b0a19c5 log fallback errors as "info"
Fallback errors are not an error, but an
informational message.

This changes those errors to be logged
as "Info" instead of "Error".

After this patch, debug logs look like this;

    DEBU[0050] Calling GET /_ping
    DEBU[0050] Calling POST /v1.27/images/create?fromImage=localhost%3A5000%2Ffoo&tag=latest
    DEBU[0050] Trying to pull localhost:5000/foo from https://localhost:5000 v2
    WARN[0050] Error getting v2 registry: Get https://localhost:5000/v2/: http: server gave HTTP response to HTTPS client
    INFO[0050] Attempting next endpoint for pull after error: Get https://localhost:5000/v2/: http: server gave HTTP response to HTTPS client
    DEBU[0050] Trying to pull localhost:5000/foo from http://localhost:5000 v2
    INFO[0050] Attempting next endpoint for pull after error: manifest unknown: manifest unknown
    DEBU[0050] Trying to pull localhost:5000/foo from https://localhost:5000 v1
    DEBU[0050] attempting v1 ping for registry endpoint https://localhost:5000/v1/
    DEBU[0050] Fallback from error: Get https://localhost:5000/v1/_ping: http: server gave HTTP response to HTTPS client
    INFO[0050] Attempting next endpoint for pull after error: Get https://localhost:5000/v1/_ping: http: server gave HTTP response to HTTPS client
    DEBU[0050] Trying to pull localhost:5000/foo from http://localhost:5000 v1
    DEBU[0050] [registry] Calling GET http://localhost:5000/v1/repositories/foo/images
    ERRO[0050] Not continuing with pull after error: Error: image foo:latest not found

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 86061441593f8c768781681db2268bc1ab6d043e
Component: engine
2017-02-24 14:27:35 +01:00
cdf7829892 fix some typos from module contrib to man
Signed-off-by: Aaron.L.Xu <likexu@harmonycloud.cn>
Upstream-commit: e0577d5fe876ec92de21c808c31e97e052654223
Component: engine
2017-02-18 10:08:55 +08:00
e2ff499d5e Merge pull request #29001 from darrenstahlmsft/WindowsOnLinux
Block pulling Windows images on non-Windows daemons
Upstream-commit: c31f73abfda14fa2fd75d8eb0a04221066a93dca
Component: engine
2017-02-16 19:57:54 +01:00
2260389fe6 Use distribution reference
Remove forked reference package. Use normalized named values
everywhere and familiar functions to convert back to familiar
strings for UX and storage compatibility.

Enforce that the source repository in the distribution metadata
is always a normalized string, ignore invalid values which are not.
Update distribution tests to use normalized values.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 3a1279393faf78632bf169619d407e584da84b66
Component: engine
2017-02-07 11:08:37 -08:00
be857bf709 Block Windows images on Linux
Signed-off-by: Darren Stahl <darst@microsoft.com>
Upstream-commit: d55304065b8de2adf9a18e195ca9224e3c04a7ca
Component: engine
2017-02-02 11:07:30 -08:00
b79ceebd76 Add tracking to elided layer pulls.
Signed-off-by: Matt Moore <mattmoor@google.com>
Upstream-commit: d5482089bfd0348ed886be9f89c4d6b177cc6dce
Component: engine
2017-01-31 16:36:17 -08:00
0dedd22a73 Merge pull request #30043 from dmcgowan/distribution-reference-update-1
Distribution reference update
Upstream-commit: e9c0de0de65182915d1cd205f06f5c903c20a29f
Component: engine
2017-01-24 20:38:20 -08:00
060b9f6e35 Merge pull request #30262 from aaronlehmann/text-html
distribution: Add text/html and application/json as image mediatypes
Upstream-commit: f6337649133ceb300a18e604ae96ca8a30c42541
Component: engine
2017-01-24 01:13:35 +01:00
027b11b8c3 Remove use of forked reference package for cli
Use resolving to repo info as the split point between the
legitimate reference package and forked reference package.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 0421f5173dbdcb4e4eade5267f274302bb6ab97c
Component: engine
2017-01-19 16:04:50 -08:00
c4cc189597 distribution: Add text/html and application/json as image mediatypes
As noted by #30083, the new strict checking of mediatypes misses some
cases where earlier bugs caused nonstandard mediatypes to be stored in
manifests. Two of the known cases are text/html and application/json,
which were returned by certain registries and stored by earlier versions
of Docker. Add special cases for text/html and application/json.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: a215e15cb1fbecc3b22d4f90e15638728ac7ac78
Component: engine
2017-01-19 11:16:28 -08:00
d24367c4ff Merge pull request #30165 from xulike666/fix-typo-6/36
[combined] fix typo 
Upstream-commit: de0328560b818e86fd3eadc973f90341e5c33498
Component: engine
2017-01-19 17:21:22 +01:00
2db1bd6f28 fix typo
fix typo I found AMAP in integration-cli/*

fix typo mentioned by Allencloud

Signed-off-by: Aaron.L.Xu <likexu@harmonycloud.cn>
Upstream-commit: 40af5691648c5b9d07b1231e3ed3be29fd66521a
Component: engine
2017-01-19 15:52:28 +08:00
287ee51be3 Refactoring ineffectual assignments
This patch fixed below 4 types of code line
1. Remove unnecessary variable assignment
2. Use variables declaration instead of explicit initial zero value
3. Change variable name to underbar when variable not used
4. Add erro check and return for ignored error

Signed-off-by: Daehyeok Mun <daehyeok@gmail.com>
Upstream-commit: 6306019d0bad9c4e60ee437e93f2450dfb0b68c0
Component: engine
2017-01-13 00:27:01 -07:00
8d865a6c15 storeLayer.Parent should return describableStoreLayers
When storeLayer.Parent returns the parent layer, it needs to use the same logic as Get where it wraps in a describablyStoreLayer if the layer is describable. Otherwise, on Windows, this can result in pushing the foreign layers, which is not supposed to be allowed.
This fixes https://github.com/docker/docker/issues/30080.

Signed-off-by: Stefan J. Wernli <swernli@microsoft.com>
Upstream-commit: d14b7212ad7b2b161afc6f0c9ac08daae14198c0
Component: engine
2017-01-11 19:01:13 -08:00
775c5633ef *: use opencontainers/go-digest package
The `digest` data type, used throughout docker for image verification
and identity, has been broken out into `opencontainers/go-digest`. This
PR updates the dependencies and moves uses over to the new type.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
Upstream-commit: 7a855799175b6b984886ef1cfa337d6df1d4c668
Component: engine
2017-01-06 18:48:41 -08:00
6b3d2b6135 Merge pull request #28631 from likel/master
Don't do format if it's unnecessary
Upstream-commit: d6be0e98027611cfb14a3246ca797bee0936e649
Component: engine
2016-12-30 01:13:12 +01:00
da7df1bf03 Merge pull request #29684 from vdemeester/quick-unit
Enhance pkg/{httputils,integration}, distribution/xfer unit tests
Upstream-commit: 631f51015eb2590cab369085dbf262e825b0cf6e
Component: engine
2016-12-28 10:57:56 -05:00
4f858d145b Enhance pkg/{httputils,integration}, distribution/xfer unit tests
- Make it possible to define a shorter waiting time of httputils
- Make a small hack to reduce the waiting time on distribution/xfer

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 522bfd926bcd8b031019e31cea41ce559cebc9b8
Component: engine
2016-12-28 11:54:05 +01:00
96e9f269ff Merge pull request #29666 from tonistiigi/client-deps
Clean up client binary dependencies
Upstream-commit: bf6eb855391e166a65db284567686fafbe4a9a0a
Component: engine
2016-12-27 15:01:24 -05:00
96e0490c24 Remove unused variable
Signed-off-by: yuexiao-wang <wang.yuexiao@zte.com.cn>
Upstream-commit: 08c6575cafd549a9d6688fab218377d73889ba72
Component: engine
2016-12-28 03:20:41 +08:00
7c2700ecf9 Remove redundant format
Signed-off-by: Ke Li <kel@splunk.com>

Add missing changes

Signed-off-by: Ke Li <kel@splunk.com>

User errors.New to create error

Signed-off-by: Ke Li <kel@splunk.com>
Upstream-commit: 514adcf4580effa4820be8d5e6d2c0ea9825ceb2
Component: engine
2016-12-27 21:46:52 +08:00
1c2e3ffc9c Define PushResult in api types
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 13222160e84a01db2174c0dbf3000761a756fd72
Component: engine
2016-12-26 18:53:22 -08:00
478844dff8 Implement content addressability for plugins
Move plugins to shared distribution stack with images.

Create immutable plugin config that matches schema2 requirements.

Ensure data being pushed is same as pulled/created.

Store distribution artifacts in a blobstore.

Run init layer setup for every plugin start.

Fix breakouts from unsafe file accesses.

Add support for `docker plugin install --alias`

Uses normalized references for default names to avoid collisions when using default hosts/tags.

Some refactoring of the plugin manager to support the change, like removing the singleton manager and adding manager config struct.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
Upstream-commit: 3d86b0c79b16334ce5836c0315e4c310b84c2e17
Component: engine
2016-12-23 13:29:58 -08:00
09a9069bac Merge pull request #29628 from liliVicky/my-feature4
modify some errors of plurality
Upstream-commit: 748a9a3f9cb804576a5fb58d11608d759160b3da
Component: engine
2016-12-22 15:40:30 -05:00
433a6ae35a Merge pull request #29314 from vdemeester/no-more-utils
Remove the utils package
Upstream-commit: b9ee31ae027bbd62477fea3f58023c90f051db00
Component: engine
2016-12-22 15:21:05 +01:00
409b30fc55 modify some files
Signed-off-by: liwenqi <vikilwq@zju.edu.cn>

update some files in the folder of distribution/xfer

Signed-off-by: liwenqi <vikilwq@zju.edu.cn>

correct again

Signed-off-by: liwenqi <vikilwq@zju.edu.cn>
Upstream-commit: 128d07d3493aeee8ec6a044039f032aeb2adf699
Component: engine
2016-12-22 08:38:37 +08:00
c162add86f Abstract distribution interfaces from image specific types
Move configurations into a single file.
Abstract download manager in pull config.
Add supports for schema2 only and schema2 type checking.
Add interface for providing push layers.
Abstract image store to generically handle configurations.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
Upstream-commit: 3c7676a057a4c0103895f793e407dc6736df139a
Component: engine
2016-12-19 10:55:00 -08:00
e31c4556e5 Merge pull request #29230 from vieux/remove_old_media_type_plugin
remove old media type compat for plugins
Upstream-commit: 8de2336f078af8467900e0c6591e5732755733bc
Component: engine
2016-12-12 12:43:32 -08:00
74e9315982 Move utils.TestDirectory to pkg/testutil/tempfile
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 0ab9320ab28afbf62a8b81e5f151db908897df86
Component: engine
2016-12-12 09:28:32 +01:00
aacf384e2f Merge pull request #28459 from dmcgowan/plugin-repository-pinning
Plugin repository pinning
Upstream-commit: c1a1b381f91367afa94a69649d9aa808acecc8ac
Component: engine
2016-12-08 11:28:52 -08:00
c7e69feeb2 remove old media type compat for plugins
Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: f644e758bd58f7b045a52b29038ae0043b0c9e3d
Component: engine
2016-12-07 17:35:09 -08:00
2b617fb9ed Merge pull request #28966 from aaronlehmann/push-panic
distribution: Fix panic on push
Upstream-commit: 523ad6ac716e53960a3185c744e5fd7ad30f20d5
Component: engine
2016-11-30 07:26:58 -08:00
9ef956d599 Merge pull request #28954 from darrenstahlmsft/UnknownBlobRetry
Stop retrying pull on UnkownBlob error
Upstream-commit: b5f4d3f716306c056d12bef3d70563cec720aeee
Component: engine
2016-11-30 10:05:16 +01:00
7c1b0ed535 distribution: Fix panic on push
When building a manifest during a push operation, all layers must have
an associated descriptor. If a layer is missing a descriptor, that leads
to a panic.

A break inside a switch in layerAlreadyExists meant to break from the
loop surrounding the switch, but instead breaks from the switch. This
causes the loop to continue, and can overwrite the descriptor with an
empty one, leading to the panic.

Also, fix layerAlreadyExists not to abort the push when a speculative
stat on a candidate layer digest fails with an error. This could happen
in situations like a potential cross-repository mount where the user
does not have permission to access the source repository.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: e0702e9f373f5086f53de2485262dde9fc1e7ac2
Component: engine
2016-11-29 18:13:39 -08:00
433038fc01 Refactoring functions
Modified newV1DependencyImage and generateDependencyImages not to return
errors instead of always return nil.

Signed-off-by: Daehyeok Mun <daehyeok@gmail.com>
Upstream-commit: d117a2f614514a38cc8c3ec97d262213cc78fb63
Component: engine
2016-11-29 16:52:37 -07:00
0a17f3799b Stop retrying pull on UnkownBlob error
Signed-off-by: Darren Stahl <darst@microsoft.com>
Upstream-commit: dee2968560dba92061ec1acbec7effe94472823f
Component: engine
2016-11-29 15:06:25 -08:00
47bad37f72 Add class to repository scope
Expose registry error translation for plugin distribution

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: a12b466183e03621bc9e1c1e4deab6db8ec93f0a
Component: engine
2016-11-21 22:18:50 -08:00
98fb763827 Move CreateRWLayer() parameters in a struct
Move some of the optional parameters of CreateRWLayer() in a struct
called CreateRWLayerOpts. This will make it easy to add more options
arguments without having to change signature of CreateRWLayer().

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: f7f3d34210fd8d25a929c6b9048e74e7ee40a558
Component: engine
2016-11-16 16:31:23 -05:00
3fc4b494de Update pull error handling
Translate pull errors to provide a more consistent and user friendly
error message.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 19a93a6e3d4213c56583bb0c843cf9e33d379752
Component: engine
2016-11-10 17:34:12 -08:00
874be028c3 Update for distribution vendor
Handle updates to reference package.
Updates for refactoring of challenge manager.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: c85eb008416f352327b67dce351101591cd5f781
Component: engine
2016-11-10 17:34:12 -08:00
b0b2a12b08 update media_type
Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: 970b23db2e97e1671c6bf4b57bfe5d1a30e98819
Component: engine
2016-11-10 15:51:32 -08:00
5a8e3be256 distribution: Remove misleading comment
Remove the following comment in pullV2Tag:

// NOTE: not using TagService.Get, since it uses HEAD requests
// against the manifests endpoint, which are not supported by
// all registry versions.

This is actually not an issue, because TagService.Get does a fallback to
GET if HEAD fails. It has done this ever since TagService was added to
the distribution API, so this comment was probably based on an early
version of TagService before it was merged, or was always a
misunderstanding.

However, we continue to use ManifestService.Get instead because it
saves a round trip. The manifest can be retrieved directly instead of
resolving the digest first.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 99c59d5988d20a6722224da918fdec299d3aaded
Component: engine
2016-11-04 17:10:47 -07:00
c7c95dc226 Adds ability to squash image after build
Allow built images to be squash to scratch.
Squashing does not destroy any images or layers, and preserves the
build cache.

Introduce a new CLI argument --squash to docker build
Introduce a new param to the build API endpoint `squash`

Once the build is complete, docker creates a new image loading the diffs
from each layer into a single new layer and references all the parent's
layers.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 362369b4bbea38881402d281ee2015d16e8b10ce
Component: engine
2016-11-01 13:41:59 -04:00