Commit Graph

362 Commits

Author SHA1 Message Date
b8a7d29c01 Merge pull request #15389 from aidanhs/aphs-simpler-pull-codepath
Remove unnecessary function parameter, add mirror endpoint test
Upstream-commit: 137df3048c4aac0e5e22118f8e9f2c46717b9f64
Component: engine
2015-08-24 11:03:01 -07:00
ccb1fbf0e4 Merge pull request #15417 from icecrime/update_windows_registry_endpoint
Update Windows TP3 registry endpoints
Upstream-commit: 3dc30d47e196b19a364eed46ecfdde8550f1b9f6
Component: engine
2015-08-18 20:35:02 -07:00
2c6e673ce7 typofix - https://github.com/vlajos/misspell_fixer
Signed-off-by: Veres Lajos <vlajos@gmail.com>
Upstream-commit: 514623272398574c8fd7ef3fe42c5b2ae161349a
Component: engine
2015-08-07 23:25:49 +01:00
3ab9629bd8 Update Windows TP3 registry endpoints
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
Upstream-commit: c7e1f91a9efc44a65e70913373e014abfb16f057
Component: engine
2015-08-07 14:03:46 -07:00
b0a38c37db Merge pull request #15370 from cpuguy83/better_error_on_client_connect
Better/more specific error messages on connect
Upstream-commit: 0262d40ba7d2edc67077a17aebbcdca1e2472a1e
Component: engine
2015-08-07 13:00:44 -07:00
8e338445b7 Remove unnecessary func parameter, add mirror endpoint test
Signed-off-by: Aidan Hobson Sayers <aidanhs@cantab.net>
Upstream-commit: c016d2defdd640f0dcba384999482e3c80602c30
Component: engine
2015-08-07 02:25:41 +01:00
9970a2eed5 registry: Do not push to mirrors
This patch splits LookupEndpoints into LookupPullEndpoints and
LookupPushEndpoints so that mirrors added with --registry-mirror are
skipped in the list returned by LookupPushEndpoints.

Fixes https://github.com/docker/distribution/issues/823

Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: b899977ee283d6bccf35ad9a079ed92a291ad34c
Component: engine
2015-08-06 17:41:59 -04:00
13560065bd Better/more specific error messages on connect
Closes #15309

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 9994a35b5d4af281304b5146f88a225b9237712e
Component: engine
2015-08-06 16:41:37 -04:00
d750e0c75b Windows: Fix certificate directory for registry
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 831b00303f1979dda6ed66980fc32a65f9229768
Component: engine
2015-08-05 13:25:41 -07:00
761b152e62 Fix uses of "int" where "int64" should be used instead
Some structures use int for sizes and UNIX timestamps. On some
platforms, int is 32 bits, so this can lead to the year 2038 issues and
overflows when dealing with large containers or layers.

Consistently use int64 to store sizes and UNIX timestamps in
api/types/types.go. Update related to code accordingly (i.e.
strconv.FormatInt instead of strconv.Itoa).

Use int64 in progressreader package to avoid integer overflow when
dealing with large quantities. Update related code accordingly.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 1f61084d83aea37b212468aaa975020094b7f7c9
Component: engine
2015-07-31 16:31:40 -07:00
c85fe1e185 Merge pull request #14970 from tiborvass/windows-registry-endpoint
registry: Change default endpoint on windows to a windows-specific one
Upstream-commit: ad96fc310b52b41463ecc52f0a03c2022866e867
Component: engine
2015-07-30 22:41:34 -04:00
b3ca0f119a registry: allow fallback on unknown errors
This patch fixes a bug where a user specifies a v1 mirror for
--registry-mirror and pull an image from the Hub.

It used to not fallback because of an unexpected error returned when
trying to JSON marshal nginx output.

We now ensure that any unexpected error falls back to the next endpoint
in the list.

Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: a21ba12f4e7f11c17e6d665716f3060b9923b11c
Component: engine
2015-07-30 19:03:38 -04:00
3216ae6bbb registry: Change default endpoint on windows to a windows-specific one
Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: 4a92b8a0ef355aec76fcaedb62c573e3a7fa21a7
Component: engine
2015-07-30 14:52:41 -04:00
d620a32c7b Fix login and search TLS configuration
Currently login and search do not load per registry certificates.
This is a regression caused by the last refactor since this was recently fixed.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: e863a07b89599fd4a03d34491d67c09c6bc84444
Component: engine
2015-07-28 10:36:57 -07:00
7e6fe45a4f Use notary library for trusted image fetch and signing
Add a trusted flag to force the cli to resolve a tag into a digest via the notary trust library and pull by digest.
On push the flag the trust flag will indicate the digest and size of a manifest should be signed and push to a notary server.
If a tag is given, the cli will resolve the tag into a digest and pull by digest.
After pulling, if a tag is given the cli makes a request to tag the image.

Use certificate directory for notary requests

Read certificates using same logic used by daemon for registry requests.

Catch JSON syntax errors from Notary client

When an uncaught error occurs in Notary it may show up in Docker as a JSON syntax error, causing a confusing error message to the user.
Provide a generic error when a JSON syntax error occurs.

Catch expiration errors and wrap in additional context.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: ed13c3abfb242905ec012e8255dc6f26dcf122f6
Component: engine
2015-07-24 14:08:20 -07:00
4d9279a3fb Improve documentation and golint compliance of registry package
* Add godoc documentation where it was missing

* Change identifier names that don't match Go style, such as INDEX_NAME

* Rename RegistryInfo to PingResult, which more accurately describes
  what this structure is for. It also has the benefit of making the name
  not stutter if used outside the package.

Updates #14756

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 4fcb9ac40ce33c4d6e08d5669af6be5e076e2574
Component: engine
2015-07-24 11:55:07 -07:00
12234c67d4 cli: new daemon command and new cli package
This patch creates a new cli package that allows to combine both client
and daemon commands (there is only one daemon command: docker daemon).

The `-d` and `--daemon` top-level flags are deprecated and a special
message is added to prompt the user to use `docker daemon`.

Providing top-level daemon-specific flags for client commands result
in an error message prompting the user to use `docker daemon`.

This patch does not break any old but correct usages.

This also makes `-d` and `--daemon` flags, as well as the `daemon`
command illegal in client-only binaries.

Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: 96ce3a194aab2807fdd638825b9ea7cb9ba55c36
Component: engine
2015-07-23 19:44:46 -04:00
a17d5470f0 better i/o timeout error on pull
Signed-off-by: Jessica Frazelle <princess@docker.com>
Upstream-commit: ca3dae523bd910bb0cbfa77b0f442a5177f2b04e
Component: engine
2015-07-21 19:08:15 -07:00
5898d8c33d Merge pull request #14829 from RichardScothern/registry-tls
Configure TLS for private v2 registry mirrors.
Upstream-commit: 42533e323cc6f996cd3eda41172dfdc6affeacd9
Component: engine
2015-07-21 19:23:39 -04:00
82b193c1f9 Remove v1 registry mirror configuration from LookupEndpoints.
V1 mirrors do not mirror the index and those endpoints should
only be indexes.

Signed-off-by: Richard Scothern <richard.scothern@gmail.com>
Upstream-commit: 6b36a488e77c9d91c8eacb07053bff263bda04f3
Component: engine
2015-07-21 15:21:41 -07:00
62d1021452 Configure TLS for private registry mirrors.
If a registry mirror is using TLS, ensure that certs for it
are picked up from /etc/docker/certs.d

Signed-off-by: Richard Scothern <richard.scothern@gmail.com>
Upstream-commit: cb57b256892b7d6c046cf28e45b9114f28f07aa3
Component: engine
2015-07-21 15:21:25 -07:00
87771732a3 Remove unused types in registry package
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 9e76e184e4c4b7df90c594b5323b2e423688e490
Component: engine
2015-07-21 11:53:57 -07:00
17583ad6dc Remove dead code in registry package
The only uses of RequestAuthorization and its associated functions were
removed in 19515a7ad859b28c474d81e756ac245afcd968e3 ("Update graph to
use vendored distribution client for the v2 codepath")

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 962dc622d94a17a30a5926e8155da87a7e39e933
Component: engine
2015-07-21 11:45:53 -07:00
66d10b96a0 golint for cliconfig
- fully capitalize HTTP in HTTPHeaders
 - comment for CONFIGFILE
 - camelcase and privatize oldConfigfile, defaultIndexserver
 - remove unused var errConfigFileMissing
 - comments for methods and functions throughout
 - external references to renamed variables changed

Signed-off-by: Morgan Bauer <mbauer@us.ibm.com>
Upstream-commit: dea49b7474f0efcefe4618b6133330f0bb5e2c84
Component: engine
2015-07-20 16:48:58 -07:00
371476f565 fix 8926: rmi dangling is unsafe when pulling
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: 1b67c38f6f4a709e1d159445b56f0beee8cfad3a
Component: engine
2015-07-17 11:39:57 -04:00
1492d5ce64 Update graph to use vendored distribution client for the v2 codepath
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: 19515a7ad859b28c474d81e756ac245afcd968e3
Component: engine
2015-07-16 13:13:47 -04:00
0a78587632 remove pkg/transport and use the one from distribution
Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: 276c640be4b4335e3b8d684cb3562a56d3337b39
Component: engine
2015-07-16 13:13:46 -04:00
f26a2613c1 Fix issue where Search API endpoint would panic due to empty AuthConfig
Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: b32c4cb4594bb27496e4f75163b7a1ed93fd06bd
Component: engine
2015-07-16 12:38:44 -04:00
23dc4e4dc4 Merge pull request #14332 from ankushagarwal/failedLogin
Add 500 check for registry api call
Upstream-commit: 46aea60fb0f52aba4281f742d263ee7a5eab3b98
Component: engine
2015-07-15 11:19:31 -07:00
06996e8f7f Set canonical name correctly
Currently canonical name gets set to the local name and displayed in the errors.
Canonical name should be the unique and canonical name for an image.
Use docker.io as the canonical domain for images on the public registry.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 7f48cd7dce6fdc077bcde0962e0aa0e73fb63225
Component: engine
2015-07-14 17:45:49 -07:00
630edf5b02 Merge pull request #14521 from mattmoor/authenticated-search
Add the X-Docker-Token header to the /v1/search requests.
Upstream-commit: c7d4a4b2b440f5cbbe094174bb2f23c85370787b
Component: engine
2015-07-14 15:43:28 -07:00
c4e83663e0 Allow one character repository name components
The docker/distribution dependency was updated in the previous commit to allow
repository name components to only consist of a single letter. The unit tests
have been updated to cement this change.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
Upstream-commit: 451789cf88d678ed887a29b0aeeeccab5d6c735a
Component: engine
2015-07-10 14:06:15 -06:00
be6a8bd99d Add the X-Docker-Token header to the /v1/search requests.
By adding this header AuthTransport will add Basic authentication to the request and allow 'docker search' results to include private images.

Signed-off-by: Matt Moore <mattmoor@google.com>
Upstream-commit: 5a170484d1d6fab982727987425fa154c96cf25e
Component: engine
2015-07-09 20:56:23 -07:00
5252cabcd6 Add 500 check for registry api call
Partially Addresses #14326

Signed-off-by: Ankush Agarwal <ankushagarwal11@gmail.com>
Upstream-commit: 88f02c2f33ff5caf69b93e667b52ab50e5e386ad
Component: engine
2015-07-02 12:41:24 -07:00
ac53859fd9 Remove RC4 from the list of registry cipher suites
The registry client's TLS configuration used the
default cipher list, including RC4. This change
copies the default cipher list from Golang 1.4 and
removes RC4 from that list. RC4 ciphers are considered
weak and vulnerable to a number of attacks.

Uses the tlsconfig package to define allowed ciphers.

Signed-off-by: Eric Windisch <eric@windisch.us>
Upstream-commit: 37846bff586e6f3d6bf35b66cce560ce4c57a619
Component: engine
2015-06-29 09:15:13 -04:00
ea81a648e3 Merge pull request #14046 from mattmoor/token-investigation
Unconditionally use AuthTransport.
Upstream-commit: c7ece73fa435873b83fa72279749cd004af8e4bd
Component: engine
2015-06-25 19:07:10 -07:00
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
9a1cbf52de Unconditionally add AuthTransport.
Today, endpoints implementing v2 cannot properly fallback to v1 because the underlying transport that deals with authentication (Basic / Token) doesn't get annotated.

This doesn't affect DockerHub because the DockerHub endpoint appears as 'https://index.docker.io/v1/' (in .dockercfg), and the 'v1' tricks this logic just long enough that the transport is always annotated for DockerHub accesses.

Signed-off-by: Matt Moore <mattmoor@google.com>
Upstream-commit: c2315102ff01c093750d0675c8e94aed5ed2fe46
Component: engine
2015-06-19 10:12:52 -07:00
42b7264397 Merge pull request #13070 from shishir-a412ed/cleanup_cmd_tag
Use distribution's ValidateRepositoryName for remote name validation. 
Upstream-commit: 206acbcf89d2f499b4c8423fb121516d88226a24
Component: engine
2015-06-17 23:26:27 +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
bb369494dd Use distribution's ValidateRepositoryName for remote name validation.
Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>
Upstream-commit: b8301005ffe66fb15a64735deeae707595543a92
Component: engine
2015-06-17 15:15:16 -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
f40bfd3ca4 Merge pull request #13815 from tiborvass/do-not-send-basic-auth-on-302
Do not set auth headers for registry v1 if 302
Upstream-commit: 13baeb3b70c5f145614cbbd582daa8a6fcbd2b79
Component: engine
2015-06-09 15:34:53 -07:00
366768923f Registry: remove unwanted return variable name
Signed-off-by: xiekeyang <xiekeyang@huawei.com>
Upstream-commit: a31be2512136444ce473235a35d6fd47634e3f13
Component: engine
2015-06-09 10:58:33 +08:00
f87511cc9a Do not set auth headers if 302
This patch ensures no auth headers are set for v1 registries if there
was a 302 redirect.

This also ensures v2 does not use authTransport.

Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: 123a0582b2f9522bdfb95cceabf8dd21af758300
Component: engine
2015-06-08 19:59:39 -04:00
649fae7e21 Merge pull request #13648 from tiborvass/print-debugtransport-to-test-output
registry: debugTransport should print with testing.T.Log
Upstream-commit: a06e0bb8b49819402180331d325d919f865a5fbd
Component: engine
2015-06-05 00:42:22 +02: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
3494783c1d Merge pull request #13650 from jvgogh/master
Upon HTTP 302 redirect do not include "Authorization" header on 'untr…
Upstream-commit: 278798236bdf073dd7c66e32e21d81bbf9243656
Component: engine
2015-06-02 14:23:20 -04: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
4475beb8ff Upon HTTP 302 redirect do not include "Authorization" header on 'untrusted' registries.
Refactoring in Docker 1.7 changed the behavior to add this header where as Docker <= 1.6 wouldn't emit this Header on a HTTP 302 redirect.

This closes #13649

Signed-off-by: Jeffrey van Gogh <jvg@google.com>
Upstream-commit: 65c5105fcca76c34335f689336a663c78786fd9c
Component: engine
2015-06-01 16:12:56 -07:00