Commit Graph

163 Commits

Author SHA1 Message Date
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
8585d1a8a3 Merge pull request #26564 from miminar/prevent-blob-uploads
Avoid unnecessary blob uploads
Upstream-commit: 762556c705e96749bba34b7e32a7f464186ccd41
Component: engine
2016-10-01 12:53:10 +02:00
c643e4b3fd Add Map() method to LayerStore interface
This method return a map associating a chain ID to its layer object

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
Upstream-commit: 148aef9199ef0af6d03ea53e616c9fbd23b7c5ec
Component: engine
2016-09-29 07:42:53 -07:00
225daecbb2 Different number of retries for layers of different sizes
Classify blobs into three categories based on size.
Use a very limited number of mount attempts and no existence check for
small blobs. Use more attempts for bigger blobs.

Also remember blob associations during layer existence check.

Blob digests are now checked in the target repository from newest to
latest. If the blob exists and the metadata entry does not, it will be
created. If the blob is not found, the metadata entry will be removed.

Signed-off-by: Michal Minář <miminar@redhat.com>
Upstream-commit: 81f7b1f1e50252e9fdd52111f0899d59f19ecb87
Component: engine
2016-09-29 14:16:01 +02:00
ea26fddd8a Allow to mock V2MetadataService in unit tests
Signed-off-by: Michal Minář <miminar@redhat.com>
Upstream-commit: d3bd14a4fb7513688644479da09e701bdcd00dc7
Component: engine
2016-09-29 14:16:00 +02:00
67a7e47787 Try to cross-repo mount until success
Don't fallback back immediately to blob upload if the cross-repo mount
fails and layer upload is initiated by registry.

Instead cancel the upload and re-try cross-repo mount from different
source repository before doing full re-upload.

Signed-off-by: Michal Minář <miminar@redhat.com>
Upstream-commit: c6dd51c32cfccc06e77b4f7cb2358f788753df72
Component: engine
2016-09-29 14:16:00 +02:00
fa7c15d2df Compare V2Metadata with associated auth config
to avoid unnecessary blob re-uploads.

Cross repository mount from particular repo will most probably fail if
the user pushing to the registry is not the same as the one who pulled
or pushed to the source repo.

This PR attempts first to cross-repo mount from the source repositories
associated with the pusher's auth config. Then it falls back to other
repositories sorted from the most similar to the target repo to the
least.

It also prevents metadata deletion in cases where cross-repo mount fails
and the auth config hashes differ.

Signed-off-by: Michal Minář <miminar@redhat.com>
Upstream-commit: 0928f3f2e3eda75a295b651d27f9dd992fd951a4
Component: engine
2016-09-29 14:16:00 +02:00
f5baeabbcf Windows: Add debug output to foreign layer pull
Write the foreign layer URLs being downloaded into the debug log.

Signed-off-by: John Starks <jostarks@microsoft.com>
Upstream-commit: 6b7d028085e0e6ac0c5f224f0a493839e2beeba3
Component: engine
2016-09-26 08:56:34 -07:00
945ce288c6 Merge pull request #26412 from YuPengZTE/devERR
In error, the first letter is low-case letter
Upstream-commit: bc22318e12451a495cd30be8f6a736be64e9bd3a
Component: engine
2016-09-23 14:32:27 +02:00
77630b1fc2 In error, the first letter is low-case letter
Signed-off-by: YuPengZTE <yu.peng36@zte.com.cn>
Upstream-commit: 4dbc78a5afdeaccbfe2be673d324550de4179903
Component: engine
2016-09-23 17:30:13 +08:00
00676d4d53 Generalize content addressable and reference storage
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 805223982ce7469af0fc42fc4a5115055f7b4843
Component: engine
2016-09-15 18:08:19 -07:00
e66566fbee Windows: Fix regression pulling linux images
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 8437d0a3298abf8bf3632a2764b945956ece422f
Component: engine
2016-09-09 11:40:34 -07:00
45ddc4bfcb Add engine-api types to docker
This moves the types for the `engine-api` repo to the existing types
package.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 91e197d614547f0202e6ae9b8a24d88ee131d950
Component: engine
2016-09-07 11:05:58 -07:00
eae30caa81 Cleanup pullSchema2
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Upstream-commit: cec0e2dfbddac0bf1362cfbfc94d8d4003c7da36
Component: engine
2016-09-05 15:02:14 +08:00
83016f7351 Make docker pull detect plugin content and error out.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: 9b6dcc8b9d1366d3da3c8f60f89de1a36b087b88
Component: engine
2016-08-20 12:54:35 -07:00
32be738fe0 Merge pull request #25090 from swernli/rootfs-cleanup
Removing old custom RootFS behavior on Windows.
Upstream-commit: 6c07fbd455cef4a5bda34ced4f0364639667db4d
Component: engine
2016-08-05 10:55:44 -07:00
bac80b795e Merge pull request #24822 from swernli/skipV1push
Fixing v2 registry restriction for non-linux platforms.
Upstream-commit: 0eb1323fba5a46209e4aa99282129b0673c491e3
Component: engine
2016-07-29 14:18:47 -07:00
a51fa7c69f Removing old custom RootFS behavior on Windows.
Windows base layers are no longer the special "layers+base" type, so we can remove all the special handling for that.

Signed-off-by: Stefan J. Wernli <swernli@microsoft.com>
Upstream-commit: f342b27145d8f5af27cd5de1501551af275e899b
Component: engine
2016-07-29 14:15:59 -07:00
4baacc0926 Merge pull request #24819 from Microsoft/jjh/fix24766
Windows: Block (v2) pulling Linux images
Upstream-commit: 350c0281c5b7a00f7186925bd0effc09bc55ca6e
Component: engine
2016-07-29 19:48:38 +02:00
6a43c7c1ad swarm/controller: allow cancellation to propagate
Ensure that cancellation of a pull propagates rather than continuing to
container creation. This ensures that the `Prepare` method is properly
re-entrant.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
Upstream-commit: d99c6b837ffd18ffe5bce801feb4936bf0edd2aa
Component: engine
2016-07-25 18:31:24 -07:00
51a6c88912 Fixing v2 registry restriction for non-linux platforms.
This fixes the hard coded restriction for non-linux platforms to v2 registries.  Previously, the check was above the flag parsing, which would overwrite the hard coded value and prevent correct operation.  This change also removes the related daemon flag from Windows to avoid confusion, as it has no meaning when the value is going to always be hard coded to true.

Signed-off-by: Stefan J. Wernli <swernli@microsoft.com>
Upstream-commit: adee28458c23581ac9afb163b7cce8c6bb1d2dee
Component: engine
2016-07-20 16:14:40 -07:00
a598054ea1 Windows: Block (v2) pulling Linux images
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 4e3d7ca4aeeaf6d10d0ea6f14e744fa8577715c4
Component: engine
2016-07-19 14:34:41 -07:00
158079c51b Merge pull request #24568 from dmcgowan/search-v2-auth
Allow v1 search to use v2 auth with identity token
Upstream-commit: 56fb100140f96a010dcc834ed1d1626ffbc28970
Component: engine
2016-07-14 19:11:33 +02:00
60762d8a86 Allow v1 search to use v2 auth with identity token
Updates the v1 search endpoint to also support v2 auth when an identity token is given.
Only search v1 endpoint is supported since there is not v2 search currently defined to replace it.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
Upstream-commit: 19d48f0b8ba59eea9f2cac4ad1c7977712a6b7ac
Component: engine
2016-07-13 13:30:24 -07:00
e7b616d2c8 Don't retry push on an unknown repository
If the remote registry responds with a NAME_UNKNOWN error, treat this as
a fatal error and don't retry the push.

Tested against an ECR registry.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: a12ab28e0afb8dd0a05187989dd95c9b9ca3fd68
Component: engine
2016-07-11 18:06:23 -06:00
fc151282e4 Always store the image digest when pulling and pushing an image.
Always attempt to add digest even when tag already exists.
Ensure digest does not currently exist.
When image id is mismatched, output an error log.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 33984f256b1a281b1130ac7e8edb7bc311750ccf
Component: engine
2016-06-27 10:09:57 -07:00
beb04971ed Fix parallel push of the same image to different registries
Layer uploads are deduplicated by a "key" made up of the layer DiffID
and the repository name. The repository name being used to form this key
was a remote version of the name that didn't include the name of the
registry. Consequently, pushes of the same layer in a repository with
the same remote name to different registries would wrongly be
deduplicated.

Correct the key by using the full name of the repository, which includes
the registry hostname as well as the image's name.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 1333ef3ca381976438d4ae10f6b0e9be21e1a9ba
Component: engine
2016-06-17 22:27:03 -07:00
848e510213 plugins: experimental support for new plugin management
This patch introduces a new experimental engine-level plugin management
with a new API and command line. Plugins can be distributed via a Docker
registry, and their lifecycle is managed by the engine.
This makes plugins a first-class construct.

For more background, have a look at issue #20363.

Documentation is in a separate commit. If you want to understand how the
new plugin system works, you can start by reading the documentation.

Note: backwards compatibility with existing plugins is maintained,
albeit they won't benefit from the advantages of the new system.

Signed-off-by: Tibor Vass <tibor@docker.com>
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: f37117045c5398fd3dca8016ea8ca0cb47e7312b
Component: engine
2016-06-14 14:20:27 -07:00
04ae4edf2f Fix logrus formatting
This fix tries to fix logrus formatting by removing `f` from
`logrus.[Error|Warn|Debug|Fatal|Panic|Info]f` when formatting string
is not present.

This fix fixes #23459.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: a72b45dbec3caeb3237d1af5aedd04adeb083571
Component: engine
2016-06-11 13:16:55 -07:00
9504e2f68b Merge pull request #23327 from dmcgowan/refactor-foreign-layer
Refactor foreign sources to describable interfaces
Upstream-commit: f6ff9acc63a0e8203a36e2e357059089923c2a49
Component: engine
2016-06-08 00:02:23 +02:00
61f6798519 Merge pull request #23323 from tiborvass/debug-ci
Cleanup
Upstream-commit: afc3cb03f4fc88f2826960a6ba3341a2b1ddeaef
Component: engine
2016-06-06 21:03:30 -04:00
1e36058e8c Use describable interfaces
Replace use of foreign sources with descriptors and describable

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 2c60430a3d1431e0879aa1c66ca23143de987b35
Component: engine
2016-06-06 17:49:34 -07:00
3ff13f560e Merge pull request #22866 from jstarks/foreign_layers
Support layers from external URLs
Upstream-commit: 7d08f3a5ad16446952b9b461feb0895a5c73ea58
Component: engine
2016-06-07 00:27:40 +00:00
545244368d Cleanup
Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: ccaea227e0e9356ab293610784b635c643e9a15e
Component: engine
2016-06-06 15:57:51 -07:00
35c5774373 fix typos
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: c1be45fa38e82054dcad606d71446a662524f2d5
Component: engine
2016-06-02 17:17:22 +08:00
770153eec3 Support layers from external URLs
This is used to support downloading Windows base images from Microsoft
servers.

Signed-off-by: John Starks <jostarks@microsoft.com>
Upstream-commit: 05bd04350b8348b3c3bbe3156420257313e4e804
Component: engine
2016-05-25 19:23:02 -07:00
c25dab543d Add Unit test to daemon.SearchRegistryForImages…
… and refactor a little bit some daemon on the way.

- Move `SearchRegistryForImages` to a new file (`daemon/search.go`) as
  `daemon.go` is getting pretty big.
- `registry.Service` is now an interface (allowing us to decouple it a
  little bit and thus unit test easily).
- Add some unit test for `SearchRegistryForImages`.
- Use UniqueExactMatch for search filters
- And use empty restore id for now in client.ContainerStart.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 636c276f67b3cd96a95dec2f6cfc419b7f219892
Component: engine
2016-05-24 11:07:11 +02:00
2736991181 Remove mountedLayer Mount and Unmount
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 8bb4d31b10e4c3abee9ca92535461859bbf25d46
Component: engine
2016-05-23 16:52:58 -07:00
be88ed49c5 Docker pull/push with max concurrency limits.
This fix tries to address issues raised in #20936 and #22443
where `docker pull` or `docker push` fails because of the
concurrent connection failing.
Currently, the number of maximum concurrent connections is
controlled by `maxDownloadConcurrency` and `maxUploadConcurrency`
which are hardcoded to 3 and 5 respectively. Therefore, in
situations where network connections don't support multiple
downloads/uploads, failures may encounter for `docker push`
or `docker pull`.

This fix tries changes `maxDownloadConcurrency` and
`maxUploadConcurrency` to adjustable by passing
`--max-concurrent-uploads` and `--max-concurrent-downloads` to
`docker daemon` command.

The documentation related to docker daemon has been updated.

Additional test case have been added to cover the changes in this fix.

This fix fixes #20936. This fix fixes #22443.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 7368e41c07c21a1e2c6a49abecd1c2fc76404e49
Component: engine
2016-05-11 19:44:54 -07:00
24e51ca37d Merge pull request #22316 from brettdh/registry-socks-proxy
Respect ALL_PROXY during registry operations
Upstream-commit: b16fac959b9fc36dd339c2db0d1ef9f1b65b8a72
Component: engine
2016-05-06 11:29:01 -07:00
0022a5af4e distribution: errors: do not retry on too many requests from registry
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Upstream-commit: 66fbc0c2a3e813359654f21433abf995b6687265
Component: engine
2016-05-04 18:57:55 +02:00
7762c76c64 fix typos in CHANGELOG.md and pull.go
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 1ac4c61c10b7753607d8cb17421b90475c1bd0d6
Component: engine
2016-04-29 23:33:15 +08:00
ababebc67a Respect ALL_PROXY during registry operations
Use sockets.DialerFromEnvironment, as is done in other places,
to transparently support SOCKS proxy config from ALL_PROXY
environment variable.

Requires the *engine* have the ALL_PROXY env var set, which
doesn't seem ideal. Maybe it should be a CLI option somehow?

Only tested with push and a v2 registry so far. I'm happy to look
further into testing more broadly, but I wanted to get feedback on
the general idea first.

Signed-off-by: Brett Higgins <brhiggins@arbor.net>
Upstream-commit: 207027087e71f5587ca407e20cc252f7958bc1b3
Component: engine
2016-04-25 15:08:30 -04:00
e3c27e0ed4 Safer file io for configuration files
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: ea3cbd3274664f5b16fce78d7df036f6b5c94e30
Component: engine
2016-04-21 11:31:15 -07:00
60b2b4b1f7 Vendor distribution to correct config blob media type in schema2 manifest
@nwt noticed that the media type specified in the config section of a
schema2 manifest is application/octet-stream, instead of the correct
value application/vnd.docker.container.image.v1+json.

This brings in https://github.com/docker/distribution/pull/1622 to fix
this.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: c18d03a7783bb78b7568bf3c23644888995e9a5d
Component: engine
2016-04-11 17:29:17 -07:00
212dd88448 Merge pull request #21819 from tophj-ibm/fix-ensure-emptyfs-other-architectures
Fix .ensure-emptyfs on non-x86_64 architectures
Upstream-commit: 3f39035f1862b20aa59c0e26f42794df9ff731bc
Component: engine
2016-04-09 13:40:45 -07:00