use setuptools
README.md: Add config/ prefix to config_sample.yml

This catches the docks up with 900d262 (Moved config to the config/
directory, 2013-12-09).
Merge pull request #240 from wking/readme-config-location

README.md: Add config/ prefix to config_sample.yml
Merge pull request #233 from mmerickel/feature.setuptools

use setuptools
Fix test_layers tests. Tentative fix for #248
Merge pull request #249 from dotcloud/fix-tests

Fix test_layers tests. Tentative fix for #248
Moving test_layers test to cStringIO instead of StringIO
Merge pull request #250 from dotcloud/tests-cstringio

Moving test_layers test to cStringIO instead of StringIO
Workaround headers too large problem with Glance v1 api
Switch order of add and pip install

This just updates the Dockerfile to take advantage of the ADD caching
added in 0.7.3 to speed up docker builds of the registry.

Docker-DCO-1.1-Signed-off-by: Phil Kates <me@philkates.com> (github: philk)
Merge pull request #258 from ewindisch/glance-headers-too-large

Workaround headers too large problem with Glance v1 api
added ignore files
Merge branch 'master' of github.com:dotcloud/docker-registry
Merge pull request #257 from philk/use_add_caching

Switch order of add and pip install
The secret_key is not generated automatically.

This "feature" introduced too many configuration bugs. Gunicorn now
set the pass the key automatically in the environment. If the key is not
set, the registry will not start.

Fixes #261

Docker-DCO-1.1-Signed-off-by: Sam Alba <sam.alba@gmail.com> (github: samalba)
Use exec to eliminate extra shell processes
Merge pull request #265 from rocketraman/shell-exec

Use exec to eliminate extra shell processes
index: Whitelist 'id' and 'checksum' keys for image data

The image data behind the "repository images" endpoints is documented
as only having these two keys [1], but on my existing docker-registry
instance, I see additional keys:

  # cat /var/lib/docker-registry/repositories/wking/gentoo/_index_images  | jq .
  [
    {
      "id": "9917ba282bd23e78d1caa25aac74fb9d5d305aee10db0ef84f3230ef7fc93c59",
      "Tag": "latest"
    }
  ]

Instead of storing any image-specific data that the user sends up,
this commit restricts the set of allowed keys.  This avoids
interfering with the Server.pullRepository code in the Docker source,
which uses the presence of img.Tag to decide whether or not to
download the image [2].  It also avoids trouble with the Docker server
trying to store auxiliary tags in the hard-coded ImgData struct [3].
The drawback to this extra protection against over-eager clients
pushing undocumented keys is that we'll have to update the whitelist
if new keys are added to ImgData.  This commit also doesn't cull
undocumented keys from existing image index files.  Folks with
existing registries can use jq [4] to remove them by hand.  In POSIX
shell:

  JQ='[.[] | {"id": .id, "checksum": .checksum}] | del(.[][] | select(. == null))'
  for FILE in $(find /var/lib/docker-registry/repositories/ -name _index_images)
  do
    FILTERED=$(jq "${JQ}" < "${FILE}")
    echo "${FILTERED}" > "${FILE}"
  done

[1]: http://docs.docker.io/en/latest/reference/api/index_api/#repository-images
     PUT /v1/repositories/(namespace)/(repo_name)/images
     GET /v1/repositories/(namespace)/(repo_name)/images
     PUT /v1/repositories/(repo_name)/images
     GET /v1/repositories/(repo_name)/images
[2]: https://github.com/dotcloud/docker/blob/v0.8.1/server.go#L1179
[3]: https://github.com/dotcloud/docker/blob/v0.8.1/registry/registry.go#L673
[4]: http://stedolan.github.io/jq/
Merge pull request #262 from dotcloud/fix-secret-key-config

Fix secret key config
Merge pull request #266 from wking/whitelist-image-index-keys

index: Whitelist 'id' and 'checksum' keys for image data