Commit Graph

11649 Commits

Author SHA1 Message Date
ce12855fec Fix failing integration tests
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: f29aacbc4804e3aca1c21b9411e960b2a2543da1
Component: engine
2015-01-16 11:34:45 -08:00
fb2575c794 Add token cache
Token cache prevents the need to get a new token for every registry interaction.
Since the tokens are short lived, the cache expires after only a minute.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: dd914f91d779f64e20ce86767ab4f84f40b9ef6a
Component: engine
2015-01-15 14:05:06 -08:00
45e09641f7 Remove session backup
The v2 session code will no longer update the indexEndpoint value, therefore it is not necessary to save and restore the value for use with v1.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: f11f3f6203da596f50eec0edc3c5dfb8c93bc271
Component: engine
2015-01-15 14:05:06 -08:00
5598d30646 Cleanup v2 session to require endpoint
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 9c6f8e14398e794cbe20504556c22a1c83260bd8
Component: engine
2015-01-15 14:05:06 -08:00
5fc27fb46a Refactor push and pull to move code out of cmd function
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 750b41ced42bda0ccda405c1aa7c43ded5821e40
Component: engine
2015-01-15 14:05:06 -08:00
557565cd70 Test pulling image with aliases
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
Upstream-commit: 92d5eafe03eca8ca931ddca5ef7d6e41ca25caad
Component: engine
2015-01-15 14:05:06 -08:00
30a16b5689 Add some push test coverage
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
Upstream-commit: dbec2317e503b8a0190102332168f9d0256392b7
Component: engine
2015-01-15 14:05:06 -08:00
ffe79c46c9 Tests for push to registry v2
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: f138f7bd50a1c5a435f3146f0b0298a2a4e260ce
Component: engine
2015-01-15 14:05:06 -08:00
cf62cf0f1e RegistryV2 datastructure for tests
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 2fc2862a73dbbc612f59f61f66c465d2e48bcbea
Component: engine
2015-01-15 14:05:06 -08:00
429cac7027 Install registry V2 in image
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: ef96c28754706da921644e5cf9202f9cc78d4c7e
Component: engine
2015-01-15 14:05:06 -08:00
5cfb6b6d7e Fix integration test failures
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 9a38aa0279ccae5aeded854a9cbbd7e398088ab2
Component: engine
2015-01-15 14:05:06 -08:00
e05bd85386 Fix list tags
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 1a9cdb13943c6af397472e235708cb10824681cd
Component: engine
2015-01-15 14:05:06 -08:00
dce0c9eeca Update push to sign with the daemon's key when no manifest is given
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 8ceb9d20d66097b90ca3a529da258669ef6b8412
Component: engine
2015-01-15 14:05:06 -08:00
07ca876ccc Refactor from feedback
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 25945a40c4f352a754cbd8dba9c846c7539fe463
Component: engine
2015-01-15 14:05:06 -08:00
c13d2851b8 Add Tarsum Calculation during v2 Pull operation
While the v2 pull operation is writing the body of the layer blob to disk
it now computes the tarsum checksum of the archive before extracting it to
the backend storage driver. If the checksum does not match that from the
image manifest an error is raised.

Also adds more debug logging to the pull operation and fixes existing test
cases which were failing. Adds a reverse lookup constructor to the tarsum
package so that you can get a tarsum object using a checksum label.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
Upstream-commit: 213e3d116642431adbe634d39740eddc5a81e063
Component: engine
2015-01-15 14:05:05 -08:00
2a0f9941dc Fix tests
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
Upstream-commit: 7eeda3f14de744b98b1c5aca4f2ecce87a479baa
Component: engine
2015-01-15 14:05:05 -08:00
56c1f6c9e6 Correctly check and propagate errors in v2 session
Signed-off-by: Stephen J Day <stephen.day@docker.com>
Upstream-commit: 1b43144ad8597d0d0ca089042c1162ba668259ab
Component: engine
2015-01-15 14:05:05 -08:00
445a293eb7 Get token on each request
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
Upstream-commit: d094eb6f7ffe6b608ecde54297e107e5caa0954d
Component: engine
2015-01-15 14:05:05 -08:00
21c36fbac8 Allow private V2 registry endpoints
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
Upstream-commit: 7d61255f578bae7dc5c2a5d44c50bf32bbc9f568
Component: engine
2015-01-15 14:05:05 -08:00
bd2dadaee1 Update push and pull to registry 2.1 specification
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
Upstream-commit: 0336b0cdaa74ac03003c4a933eb866fb0cec8125
Component: engine
2015-01-15 14:05:05 -08:00
93ab6ab93d Remove dependencies on registry packages
Because docker core cannot vendor non-master Go dependencies, we need to remove
dependencies on registry package. The definition of digest.Digest has been
changed to a string and the regular expressions have been ported from
docker-registry/common library.

We'll likely change this be dependent on the registry in the future when the
API stabilizies and use of the master branch becomes the norm.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
Upstream-commit: dbb4b03bfc82eadefaf68c1a81d215949980550e
Component: engine
2015-01-15 14:05:05 -08:00
d8303cd325 Registry V2 HTTP route and error code definitions
This package, ported from next-generation docker regsitry, includes route and
error definitions. These facilitate compliant V2 client implementation. The
portions of the HTTP API that are included in this package are considered to be
locked down and should only be changed through a careful change proposal.
Descriptor definitions package layout may change without affecting API behavior
until the exported Go API is ready to be locked down.

When the new registry stabilizes and becomes the master branch, this package
can be vendored from the registry.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
Upstream-commit: a0f92a26d90e870dfddae9694a5de97e36d3f586
Component: engine
2015-01-15 14:05:05 -08:00
0d8e8d5acb Update token response handling
Registry authorization token is now taken from the response body rather than
the repsonse header.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
Upstream-commit: e23362597dcaa8839271210d24bda2ba55f1e12f
Component: engine
2015-01-15 14:05:05 -08:00
6614616033 Update push to use mount blob endpoint
Using mount blob prevents repushing images which have already been uploaded

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: e9b590d85e9c622316b8be71004737f63e6b9503
Component: engine
2015-01-15 14:05:05 -08:00
eaeb1f3166 Use tarsum dev version to fix mtime issue
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 3e4fd005449448ab85c917a5d27ca584b260309c
Component: engine
2015-01-15 14:05:05 -08:00
321425170a Update manifest format for push
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: bcc0a343bb9c75443238e614e4c2da5f707aef8d
Component: engine
2015-01-15 14:05:05 -08:00
6a46693a7d Push flow
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 188b56c836e49e3c888e1e27e4e26b5cc0f1caaa
Component: engine
2015-01-15 14:05:05 -08:00
c07ed3a544 Add trust key creation on client
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: ac8d964b28f23c9790102462a040054e7857cb26
Component: engine
2015-01-15 14:04:14 -08:00
e89bb2e57b Adds support for v2 registry login
summary of changes:

registry/auth.go
  - More logging around the login functions
  - split Login() out to handle different code paths for v1 (unchanged logic)
    and v2 (does not currently do account creation)
  - handling for either basic or token based login attempts
registry/authchallenge.go
  - New File
  - credit to Brian Bland <brian.bland@docker.com> (github: BrianBland)
  - handles parsing of WWW-Authenticate response headers
registry/endpoint.go
  - EVEN MOAR LOGGING
  - Many edits throught to make the coad less dense. Sparse code is more
    readable code.
  - slit Ping() out to handle different code paths for v1 (unchanged logic)
    and v2.
  - Updated Endpoint struct type to include an entry for authorization
    challenges discovered during ping of a v2 registry.
  - If registry endpoint version is unknown, v2 code path is first attempted,
    then fallback to v1 upon failure.
registry/service.go
  - STILL MOAR LOGGING
  - simplified the logic around starting the 'auth' job.
registry/session.go
  - updated use of a registry.Endpoint struct field.
registry/token.go
  - New File
  - Handles getting token from the parameters of a token auth challenge.
  - Modified from function written by Brian Bland (see above credit).
registry/types.go
  - Removed 'DefaultAPIVersion' in lieu of 'APIVersionUnknown = 0'`

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
Upstream-commit: 41e20cecb9944137de82ff5fa0898f953aa2bf87
Component: engine
2015-01-15 14:04:14 -08:00
00273b496a Merge pull request #10109 from ankushagarwal/imagespec-typo
Fix typos in image spec v1
Upstream-commit: 3837c080228143378b1041364a90aa5bcf59fa00
Component: engine
2015-01-15 08:58:29 -08:00
647f575a6c Typo creating -> created
Signed-off-by: Ankush Agarwal <ankushagarwal11@gmail.com>
Upstream-commit: 82bfb3852ea0835d96d456c256f40633b020bd1e
Component: engine
2015-01-14 23:02:17 -08:00
10d8a73193 ignore vfs from warning
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Upstream-commit: f88066fd43454be005ec303977ee45561f3436e6
Component: engine
2015-01-14 17:28:50 -08:00
387cdea261 Typo image -> container
Signed-off-by: Ankush Agarwal <ankushagarwal11@gmail.com>
Upstream-commit: 034466d356ecc5bc993f255c5ec5fb96e7327b8b
Component: engine
2015-01-14 17:18:11 -08:00
f71acef86e Merge pull request #9881 from tianon/json-array-of-strings
Adjust builder to validate that JSON in Dockerfiles are arrays of strings and nothing else to match how we describe them to people (and what all our existing tests already assumed)
Upstream-commit: 640e0fc578e5acdaa71216a300396dfa9af8054f
Component: engine
2015-01-14 17:13:51 -08:00
e2b5d6afd7 Merge pull request #10108 from tiborvass/carry-9989
[Carry] Fix a panic where RUN [] would be supplied
Upstream-commit: eaecf741f0e00a09782d5bcf16159cc8ea258b67
Component: engine
2015-01-14 17:12:59 -08:00
28b575d46d Merge pull request #10106 from icecrime/win_integration_tests
Fix some Windows integration tests
Upstream-commit: c126a2303fccc074f2382d01a2b685a1836cd621
Component: engine
2015-01-14 17:04:49 -08:00
a22356060c Merge pull request #10107 from jfrazelle/9328-fix-try-start-paused-container
Error should show when trying to start a paused container.
Upstream-commit: 27f69b077703607862afa4a75c929ed07396ac2b
Component: engine
2015-01-14 17:02:23 -08:00
f2f058e60b builder: use len() > 0 instead of != nil
Signed-off-by: Tibor Vass <teabee89@gmail.com>
Upstream-commit: 3183af8b19d2adf29dd3fb80689d764353a3fe00
Component: engine
2015-01-14 16:55:56 -08:00
869bebb91c Fix a panic where RUN [] would be supplied.
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Upstream-commit: 39343b86182b4e997dc991645729ae130bd0f5f2
Component: engine
2015-01-14 16:55:56 -08:00
11776a4f9e Error should show when trying to start a paused container.
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Upstream-commit: 02246d2d9f9fe8eb040d1eb1ac4b7a84c3f3f059
Component: engine
2015-01-14 16:49:08 -08:00
7467fc1bd7 Take DOCKER_TEST_HOST into account
Tests no longer make the assumption that the daemon can be accessed
through unix:///var/run/docker.sock.

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
Upstream-commit: e1ef33449f484678d236cb49e80daf5ba1e1899c
Component: engine
2015-01-14 16:14:27 -08:00
2a3eb3ae39 Merge pull request #10093 from crosbymichael/readonly-containers
Add --read-only for read only container rootfs
Upstream-commit: 95c0f07966035ce79c6b51a2eee8c60c59fb523c
Component: engine
2015-01-14 15:56:51 -08:00
2ef8faf6e3 Add --readonly for read only container rootfs
Add a --readonly flag to allow the container's root filesystem to be
mounted as readonly.  This can be used in combination with volumes to
force a container's process to only write to locations that will be
persisted.  This is useful in many cases where the admin controls where
they would like developers to write files and error on any other
locations.

Closes #7923
Closes #8752

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 409407091a7282d0c4086b71e86397e2d089ba13
Component: engine
2015-01-14 15:41:31 -08:00
d149e702e3 Merge pull request #10101 from LK4D4/fix_vet_errors
Fix vet errors
Upstream-commit: 3118ccc6bcd2a2d63700584dc1ce2dbb0a65cbb6
Component: engine
2015-01-14 15:18:20 -08:00
8d01a3ebdf Add build constraint.
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Upstream-commit: 798215af24953f5e3dcacb08965f3714b2fd903f
Component: engine
2015-01-14 14:40:07 -08:00
8b29f19b21 Fix format calls as suggested by vet
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: a75b02fe72f3da73f9788919ff2c22f183978db7
Component: engine
2015-01-14 14:12:03 -08:00
6d98dd3144 Fix vet error about passing Mutex by value
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: bb96e53b0f947a31a4b66e76607eed0097917ed5
Component: engine
2015-01-14 14:03:00 -08:00
2c43314302 Calming vet about type aliases from other package
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 5ce60217f1ba07015af72978e715a08259e2efc1
Component: engine
2015-01-14 14:01:36 -08:00
c664f952ef Merge pull request #10082 from jfrazelle/10081-fix-renaming
Renaming a container with an invalid name should fail
Upstream-commit: f67c6d313b971a068262a09840f7afdf4d34b292
Component: engine
2015-01-14 13:12:36 -08:00
4fdee94024 Renaming a container with an invalid name should fail
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Upstream-commit: a92281637f5b629e110b5bd074566bb6c302bb62
Component: engine
2015-01-14 12:54:23 -08:00