Commit Graph

158 Commits

Author SHA1 Message Date
6ae4c9014c update go import path and libcontainer
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: b3ee9ac74e171e00f14027e39278013629e681b8
Component: engine
2014-07-24 22:19:50 +00:00
a8f0d4ce31 Merge pull request #6727 from unclejack/improve_bytes_range
Improve layer downloading
Upstream-commit: 683038bf57ce56c2f8eb433eb9bd00b2c17cae92
Component: engine
2014-07-23 15:31:25 -04:00
0f53a7cb8b Merge pull request #7146 from dmp42/master
Joining registry maintainers
Upstream-commit: b7ff33f73c258d8c2a8ffba8f6abb46114328a58
Component: engine
2014-07-21 17:02:52 -07:00
f24b5ec2fa Joining registry maintainers
Docker-DCO-1.1-Signed-off-by: Olivier Gambier <olivier@docker.com> (github: dmp42)
Upstream-commit: ebc05cbbea55d6a77f1ba159b7df4c4a9c6468f3
Component: engine
2014-07-22 01:50:32 +02:00
903a38086f Merge pull request #7050 from Aigeruth/fix/push_image_layer_registry_content_type
Add Content-Type header in PushImageLayerRegistry
Upstream-commit: b752e7402aa635b858c8559ae17080f66816bf92
Component: engine
2014-07-21 15:07:01 -04:00
43007a03a7 get layer: remove HEAD req & pass down response
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: c47ebe7a351bc639028cd48aed9d2fa2310a2a65
Component: engine
2014-07-21 20:21:18 +03:00
1a215f0eb4 Merge pull request #3070 from alexlarsson/certificates
Upstream-commit: c7bc929e0151b01e723feca1213a1adb9ffc7d9b
Component: engine
2014-07-18 18:27:00 -07:00
077977e932 Add Content-Type header in PushImageLayerRegistry
Docker-DCO-1.1-Signed-off-by: Gabor Nagy <mail@aigeruth.hu> (github: Aigeruth)
Upstream-commit: f861bfd9ff57e87805252d27da3a9cb18f60974b
Component: engine
2014-07-16 12:23:25 +02:00
172faefd3c Fix go vet errors
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)

Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: f08cd445b0d2e44a4977a3bd0dca0a1cd4e76d2f
Component: engine
2014-06-18 17:39:57 +00:00
946f83d348 Add support for client certificates for registries
This lets you specify custom client TLS certificates and CA root for a
specific registry hostname. Docker will then verify the registry
against the CA and present the client cert when talking to that
registry.  This allows the registry to verify that the client has a
proper key, indicating that the client is allowed to access the
images.

A custom cert is configured by creating a directory in
/etc/docker/certs.d with the same name as the registry hostname. Inside
this directory all *.crt files are added as CA Roots (if none exists,
the system default is used) and pair of files <filename>.key and
<filename>.cert indicate a custom certificate to present to the registry.

If there are multiple certificates each one will be tried in
alphabetical order, proceeding to the next if we get a 403 of 5xx
response.

So, an example setup would be:
/etc/docker/certs.d/
└── localhost
    ├── client.cert
    ├── client.key
    └── localhost.crt

A simple way to test this setup is to use an apache server to host a
registry. Just copy a registry tree into the apache root, here is an
example one containing the busybox image:
  http://people.gnome.org/~alexl/v1.tar.gz

Then add this conf file as /etc/httpd/conf.d/registry.conf:

 # This must be in the root context, otherwise it causes a re-negotiation
 # which is not supported by the tls implementation in go
 SSLVerifyClient optional_no_ca

 <Location /v1>
 Action cert-protected /cgi-bin/cert.cgi
 SetHandler cert-protected

 Header set x-docker-registry-version "0.6.2"
 SetEnvIf Host (.*) custom_host=$1
 Header set X-Docker-Endpoints "%{custom_host}e"
 </Location>

And this as /var/www/cgi-bin/cert.cgi

 #!/bin/bash
 if [ "$HTTPS" != "on" ]; then
     echo "Status: 403 Not using SSL"
     echo "x-docker-registry-version: 0.6.2"
     echo
     exit 0
 fi
 if [ "$SSL_CLIENT_VERIFY" == "NONE" ]; then
     echo "Status: 403 Client certificate invalid"
     echo "x-docker-registry-version: 0.6.2"
     echo
     exit 0
 fi
 echo "Content-length: $(stat --printf='%s' $PATH_TRANSLATED)"
 echo "x-docker-registry-version: 0.6.2"
 echo "X-Docker-Endpoints: $SERVER_NAME"
 echo "X-Docker-Size: 0"
 echo

 cat $PATH_TRANSLATED

This will return 403 for all accessed to /v1 unless *any* client cert
is presented. Obviously a real implementation would verify more details
about the certificate.

Example client certs can be generated with:

openssl genrsa -out client.key 1024
openssl req -new -x509 -text -key client.key -out client.cert

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Upstream-commit: 05243104fc0a0ef9537766cf5bd920824665eb78
Component: engine
2014-06-13 11:13:18 +02:00
2272d55fbb registry: remove unneeded time.Duration()
These constants don't need to use time.Duration(). Fixup this file since
it seems to be the only one using this style.

Docker-DCO-1.1-Signed-off-by: Brandon Philips <brandon.philips@coreos.com> (github: philips)
Upstream-commit: 4a3b36f44309ff8e650be2cff74f3ec436353298
Component: engine
2014-06-08 11:04:06 -07:00
c2d0bb307f Disable timeout for push
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: 8baafacf404265c95753e63d2b7510731359c4b4
Component: engine
2014-06-07 23:48:25 +00:00
9f4eb42cca improve trusted location detection
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: daa89c420caac0881b09e2a36feff977ec43d7cd
Component: engine
2014-06-07 21:17:56 +00:00
51ac70314e only forward auth to trusted locations
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: a12453186323372f4d4e23980d3f1caa2de91e5a
Component: engine
2014-06-05 19:47:33 +00:00
792ff163c7 Add redirect and env proxy support to docker login
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: 4e7254840bc60f31e501c52e25990c540015e83b
Component: engine
2014-06-03 00:46:06 +00:00
29a9622323 resume pulling the layer on disconnect
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: 2a1b7f222a5eff596cabb5ebd88a481a83b24402
Component: engine
2014-06-02 21:41:22 +03:00
b049a6c181 Use Timeout Conn wrapper to set read deadline for downloading layer
Docker-DCO-1.1-Signed-off-by: Derek <crq@kernel.org> (github: crquan)
Upstream-commit: 02f4ae6c56474b1f4e747916812b38134d503349
Component: engine
2014-05-27 22:50:04 -07:00
575e3e1917 registry: adding vbatts to the MAINTAINERS
Docker-DCO-1.1-Signed-off-by: Vincent Batts <vbatts@redhat.com> (github: vbatts)
Upstream-commit: 6f327278446b958b32b02a3baefda26e6c8d219f
Component: engine
2014-05-06 14:31:47 -04:00
9cb0c5e8bd Merge pull request #5600 from unclejack/sha512_registry_support
import sha512 to make sha512 ssl certs work
Upstream-commit: eadf004fcba8431769b03125a6d6a8d415c79f5f
Component: engine
2014-05-05 15:27:11 -07:00
ca6804672b import sha512 to make sha512 ssl certs work
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: 7da186c3e58c83605f0389d1214909b1cbbead39
Component: engine
2014-05-05 20:29:20 +03:00
231057613f Move 'search' to the registry subsystem
This continues the effort to separate all registry logic from the
deprecated `Server` object.

* 'search' is exposed by `github.com/dotcloud/docker/registry/Service`
* Added proper documentation of Search while I was at it

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
Upstream-commit: c4089ad80bcc1466535696ac0b11d388df529391
Component: engine
2014-05-03 00:37:32 +00:00
3dfee4b46a Move 'auth' to the registry subsystem
This is the first step towards separating the registry subsystem from
the deprecated `Server` object.

* New service `github.com/dotcloud/docker/registry/Service`
* The service is installed by default in `builtins`
* The service only exposes `auth` for now...
* ...Soon to be followed by `pull`, `push` and `search`.

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
Upstream-commit: 3d605683b3d272982399635a55ee81b2a7535e81
Component: engine
2014-05-03 00:37:06 +00:00
2b9bc2685b Use proper scheme with static registry
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 44d54ba0c299540efbfa173bf484d541e857f4ac
Component: engine
2014-04-29 02:01:07 -07:00
119b7b20d7 Merge pull request #4607 from vbatts/vbatts-static_registry
static registry support
Upstream-commit: 8a5060dba47ef9d91470c16e8ec3a9db59e60695
Component: engine
2014-04-29 11:22:44 -07:00
c1aee2c6db Merge pull request #5199 from shin-/registry_mirrors_support
Added support for multiple endpoints in X-Docker-Endpoints header
Upstream-commit: 425b3156953191707f002fb36e5f14b0355e9a3c
Component: engine
2014-04-28 17:56:57 +03:00
d47df97157 static_registry: update the test for the new struct
Docker-DCO-1.1-Signed-off-by: Vincent Batts <vbatts@redhat.com> (github: vbatts)
Upstream-commit: 7790a77b6afeda6f223202288a89f4b431f033a0
Component: engine
2014-04-25 20:01:25 -04:00
ee1f88fe1b Added support for multiple endpoints in X-Docker-Endpoints header
Docker-DCO-1.1-Signed-off-by: Joffrey F <joffrey@docker.com> (github: shin-)
Upstream-commit: 720f3447046355329b5ba5d850caca84328182d5
Component: engine
2014-04-18 17:42:54 +02:00
680490e66c allow dot in repo name
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
Upstream-commit: d61fce9af770f0adaf4f178a5217dd46a02dd201
Component: engine
2014-04-14 23:15:38 +00:00
25edfd6bbc Added specific error message when hitting 401 over HTTP on push
Docker-DCO-1.1-Signed-off-by: Joffrey F <joffrey@docker.com> (github: shin-)
Upstream-commit: 8b2bcd9a4bddf1b99ca201d81ac0a67c2b09fbe0
Component: engine
2014-04-08 17:07:29 +02:00
72f522b288 Payload checksum now match the checksum simple
Backported for backward compatibility.

Docker-DCO-1.1-Signed-off-by: Sam Alba <sam.alba@gmail.com> (github: samalba)
Upstream-commit: de9fba71721f71f86d53cf94504b10dcea80a5bd
Component: engine
2014-03-31 18:31:15 -07:00
9681336973 Inverted layer checksum and tarsum.
The checksum of the payload has to be computed on the Gzip'ed content.

Docker-DCO-1.1-Signed-off-by: Sam Alba <sam.alba@gmail.com> (github: samalba)
Upstream-commit: 3f0886c8c3084341e9ef454bf41445cfc22efca2
Component: engine
2014-03-31 17:56:25 -07:00
60e20b5d78 Docker-DCO-1.1-Signed-off-by: Ryan Thomas <rthomas@atlassian.com> (github: rthomas)
Upstream-commit: d6c2188cae85549a40193273cb9893acefadf863
Component: engine
2014-03-28 06:31:04 +11:00
b645a0b182 Docker-DCO-1.1-Signed-off-by: Ryan Thomas <rthomas@atlassian.com> (github: rthomas)
Upstream-commit: a5ccb5b28d7e24a379f77ab7619f296aa500c8dd
Component: engine
2014-03-25 14:45:11 +11:00
6ed3664799 Harmonize / across all name-related commands/Validate images names
Docker-DCO-1.1-Signed-off-by: Djibril Koné <kone.djibril@gmail.com> (github: enokd)
Upstream-commit: 43c3ee3ba154e2480191ed3743391810f23f29af
Component: engine
2014-03-21 00:40:58 +01:00
f7f8c4ef4e use mock for search
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
Upstream-commit: 9a0d7fe0182da541cc99eab9a4930616792e95c3
Component: engine
2014-03-13 17:40:34 +00:00
9b38e7b5fb registry: Info collection
roll version and standalone information into the _ping. And to support
Headers they are checked after the JSON is loaded (if there is anything
to load). To stay backwards compatible, if the _ping contents are not
able to unmarshal to RegistryInfo, do not stop, but continue with the
same behavior.

Docker-DCO-1.1-Signed-off-by: Vincent Batts <vbatts@redhat.com> (github: vbatts)
Upstream-commit: 2b855afaeedcab3117876815ec2f8d4450a742b5
Component: engine
2014-03-11 23:36:51 -04:00
d6ddc55723 registry: make certain headers optional
For a pull-only, static registry, there only a couple of headers that
need to be optional (that are presently required.
* X-Docker-Registry-Version
* X-Docker-Size
* X-Docker-Endpoints

Docker-DCO-1.1-Signed-off-by: Vincent Batts <vbatts@redhat.com> (github: vbatts)
Upstream-commit: 2a2c694758d6a48125cc9adf446f2054b52db201
Component: engine
2014-03-11 10:08:44 -04:00
4fcd3ec7b6 Merge auth package within registry
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume@charmes.net> (github: creack)
Upstream-commit: 8d88ea0c15b7ce7fd2b0b695c498a7ffa0f2bc87
Component: engine
2014-03-10 17:16:58 -07:00
7ed3338517 Remove manual http cookie management
Since docker uses cookiejar it doesn't need to manage cookies manually
anymore.
Managing cookie was duplicating it.

Docker-DCO-1.1-Signed-off-by: Fabio Falci <fabiofalci@gmail.com> (github: fabiofalci)
Upstream-commit: df9b99aca0b8a65da866aa5696b9f45df3b92e50
Component: engine
2014-03-09 02:25:19 +00:00
f917ba6a35 Merge pull request #4270 from DevTable/fixregistryauth
Fix registry auth and remove other hidden ping commands from client code
Upstream-commit: 0eeb146398470bb586ce5b3f1dff28f2f4bbaa4e
Component: engine
2014-03-03 17:34:21 -08:00
2c83e8f464 registry: Fixed unexported field
Docker-DCO-1.1-Signed-off-by: Sam Alba <sam.alba@gmail.com> (github: samalba)
Upstream-commit: a0251223cdd7a52d6ae246d37363b9d78a4d8cc3
Component: engine
2014-02-25 16:06:04 -08:00
28b09e351d registry: Removed checksumPayload from exported fields
Docker-DCO-1.1-Signed-off-by: Sam Alba <sam@docker.com> (github: samalba)
Upstream-commit: 522c0765f11569feb1dbc7facfbb802e0f1fb84e
Component: engine
2014-02-24 12:40:33 -08:00
5561829e30 registry: Fixed tests
Docker-DCO-1.1-Signed-off-by: Sam Alba <sam@docker.com> (github: samalba)
Upstream-commit: f420bb29793f0196024d21121d0ef89d2c678bdf
Component: engine
2014-02-24 09:04:27 -08:00
f208199d26 registry: Added simple checksums (sha256) for layers
Docker-DCO-1.1-Signed-off-by: Sam Alba <sam@docker.com> (github: samalba)
Upstream-commit: 8d230cf89cfe3c6c5293d7807c1bffa1cf799d6b
Component: engine
2014-02-23 18:50:04 -08:00
733cdcbf96 Fix registry auth by storing the string passed on the command line, and allowing for credential selection by normalizing on hostname. Also, remove remote ping calls from CmdPush and CmdPull.
Docker-DCO-1.1-Signed-off-by: Jake Moshenko <jake@devtable.com> (github: jakedt)
Upstream-commit: 90b0cce07b4f68d8099903f7e1470f79541f45d0
Component: engine
2014-02-20 18:32:33 -05:00
3bf67918b9 Fix login prompt on push and pull because of error message
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 0fa9199f781ecd27469ca192496ce7b8e24980b1
Component: engine
2014-02-03 11:38:34 -08:00
2b1cc6e037 Added missing attributes to api search calls:
- Added an argument to the call() method in order to control the auth sharing
- Enabled it only for search. Pulls and pushes were enabled already.
- Grouped a few variable declarations

Docker-DCO-1.1-Signed-off-by: Roberto Hashioka <roberto.hashioka@docker.com> (github: rogaha)
Upstream-commit: 2cfd696b9bacda67468a0a2ef93d61258781e8bc
Component: engine
2014-01-21 04:06:19 +00:00
4963d0d960 Make sure new repositories can be pushed with multiple tags
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: a2aab7757e236a895abf7b06836d8e3b84236429
Component: engine
2014-01-20 13:39:35 -08:00
a8444009df move legacy stuff outside the job
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
Upstream-commit: 16ca6a1c12ffe9a02da4e823646bee6461ffbad5
Component: engine
2014-01-13 16:20:05 -08:00
29b6e8dfe9 Merge pull request #3431 from shin-/ping_standalone_check
Check standalone header when pinging a registry server.
Upstream-commit: 1d0aeae339aefb7f242035332ed553794b9dab01
Component: engine
2014-01-07 10:33:07 -08:00