Commit Graph

179 Commits

Author SHA1 Message Date
8a28fc553b Replace get.docker.io -> get.docker.com and test.docker.io -> test.docker.com
Signed-off-by: Tibor Vass <teabee89@gmail.com>
Upstream-commit: 808257654a4147ad9b54cfeddc5d0ad236c26e3f
Component: engine
2014-09-24 18:53:27 -04:00
b4607092ee Refactor all pre-compiled regexp to package level vars
Addresses #8057

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
Upstream-commit: 4119c9d7d955757092adc3410da8d75f972bd3c1
Component: engine
2014-09-16 12:57:44 -04:00
5f275ccb1b TarSum: versioning
This introduces Versions for TarSum checksums.
Fixes: https://github.com/docker/docker/issues/7526

It preserves current functionality and abstracts the interface for
future flexibility of hashing algorithms. As a POC, the VersionDev
Tarsum does not include the mtime in the checksum calculation, and would
solve https://github.com/docker/docker/issues/7387 though this is not a
settled Version is subject to change until a version number is assigned.

Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: 747f89cd327db9d50251b17797c4d825162226d0
Component: engine
2014-09-10 15:41:52 -04:00
0ece639e47 Merge pull request #7862 from Gandi/bugfixes/segfault-registry-session
Fix SEGFAULT if dns resolv error
Upstream-commit: 7bb5ec3be6f3f52cd1aa65e4be20a6d6526a1d3a
Component: engine
2014-09-08 11:38:34 -07:00
6dc15f86be Merge pull request #7609 from ewindisch/max_imgname
Restrict length of repository names
Upstream-commit: 18edea2a6f5b01e38e3189dbec54566ad4a67f4f
Component: engine
2014-09-08 11:06:54 -07:00
64908e2dd5 Fix SEGFAULT if dns resolv error
Per registry.doRequest, res and client might be nil in case of error
For example, dns resolution errors, /etc/docker/certs.d perms, failed
loading of x509 cert ...
This will make res.StatusCode and res.Body SEGFAULT.

Signed-off-by: Arthur Gautier <baloo@gandi.net>
Upstream-commit: 3e6c69e5a1dbb428c4a62656f96cfe77c19986f9
Component: engine
2014-09-05 13:40:06 +02:00
e62472c6f3 registry/session: fix panic in GetRemoteImageLayer
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: 9c413e3e6f1c6bd6abada707c442862049d29743
Component: engine
2014-09-03 17:26:56 +03:00
94a36f4c63 Restrict repository names from matching hexadecimal strings
To avoid conflicting with layer IDs, repository names must
not be tagged with names that collide with hexadecimal strings.

Signed-off-by: Eric Windisch <eric@windisch.us>
Upstream-commit: 0bd1c05e5c36799e0740a155092be0c9c417f175
Component: engine
2014-08-27 13:46:10 -04:00
0f8e8a7de5 Merge pull request #7740 from LK4D4/registry_style
Style fixes for registry/registry.go
Upstream-commit: 1385b2d2935c0d20e6406a80c62615a8c4cdbcc9
Component: engine
2014-08-26 18:02:11 -07:00
b5fb241c16 Style fixes for registry/registry.go
Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
Upstream-commit: 45a2923874a9b1f70674e627d0d112851d5982a8
Component: engine
2014-08-26 12:28:40 +04:00
579f334a23 fix return values in registry mock service
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Upstream-commit: e81b68692408ef717c2228986cc74102cae55772
Component: engine
2014-08-25 10:29:38 -07:00
06081e86de Expand hostname before passing it to NewRegistry()
Signed-off-by: Daniel Menet <membership@sontags.ch>
Upstream-commit: 676308b853a43bb7be4838e937ab4effff670b1a
Component: engine
2014-08-16 14:25:46 +02:00
bc706dc232 Enable docker search on private docker registry.
The cli interface works similar to other registry related commands:

  docker search foo

... searches for foo on the official hub

  docker search localhost:5000/foo

... does the same for the private reg at localhost:5000

Signed-off-by: Daniel Menet <membership@sontags.ch>
Upstream-commit: 3231033a80451adff73b53554e27fbabfebb4a4f
Component: engine
2014-08-16 14:24:32 +02:00
b8d5783511 move utils.Fataler to pkg/log.Fataler
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Upstream-commit: ac63d925d2618e700d117c5d9e402ccc0c5cecc8
Component: engine
2014-08-13 15:32:41 -07:00
4737f7cea5 Extract log utils into pkg/log
Docker-DCO-1.1-Signed-off-by: Josiah Kiehl <josiah@capoferro.net> (github: capoferro)
Upstream-commit: a02f67be5b17da63d475e6f35956c1e72c3b2e7b
Component: engine
2014-08-13 15:18:15 -07:00
955bae5653 registry.Registry -> registry.Session
renaming this struct to more clearly be session, as that is what it
handles.

Splitting out files for easier readability.

Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: 752dd707ac09cdcd88307b28aa9e39ac7c763b44
Component: engine
2014-08-13 09:27:43 -04:00
be277e6761 Merge pull request #7324 from erikh/move_tarsum
Move tarsum to pkg/
Upstream-commit: 531f5907d64ff56b0beea1de11d65885e29ee5ad
Component: engine
2014-07-31 16:56:24 -04:00
8be33461d7 Remove CheckSum from utils; replace with a TeeReader
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Upstream-commit: ef6b78f7db890a79b40484fd892ff486017ff2e9
Component: engine
2014-07-30 11:23:43 -07:00
5a8e5fe7dc utils/tarsum* -> pkg/tarsum
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Upstream-commit: 1219e458d105461fd7de23fa4b04a1233f61f8a4
Component: engine
2014-07-30 06:42:12 -07:00
e25f77248d Move parsing functions to pkg/parsers and the specific kernel handling
functions to pkg/parsers/kernel, and parsing filters to
pkg/parsers/filter. Adjust imports and package references.

Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Upstream-commit: 4398108433121ce2ac9942e607da20fa1680871a
Component: engine
2014-07-29 13:09:10 -07:00
b7f9603931 move resumablerequestreader to pkg
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: c0517857f64d1148d02809e3ba3dd39bf8322ed3
Component: engine
2014-07-29 16:30:45 +03:00
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