Skip to content
This repository was archived by the owner on Sep 12, 2018. It is now read-only.

Commit 6af878c

Browse files
committed
Merge pull request #599 from carmstrong/squashed-pr-515
Ceph Rados Gateway and other S3 compatible APIs
2 parents 0f54d7b + 75466ca commit 6af878c

File tree

3 files changed

+54
-8
lines changed

3 files changed

+54
-8
lines changed

README.md

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ The fastest way to get running:
2525
That will use the
2626
[official image from the Docker index](https://registry.hub.docker.com/_/registry/).
2727

28-
Here is another example that will launch a container on port 5000, and store images in an Amazon S3 bucket:
28+
Here is another example that will launch a container on port 5000, and store images in an Amazon S3 bucket:
2929
```
3030
docker run \
3131
-e SETTINGS_FLAVOR=s3 \
@@ -62,6 +62,7 @@ In the `config_sample.yml` file, you'll see several sample flavors:
6262
1. `common`: used by all other flavors as base settings
6363
1. `local`: stores data on the local filesystem
6464
1. `s3`: stores data in an AWS S3 bucket
65+
1. `ceph-s3`: stores data in a Ceph cluster via a Ceph Object Gateway, using the S3 API
6566
1. `dev`: basic configuration using the `local` flavor
6667
1. `test`: used by unit tests
6768
1. `prod`: production configuration (basically a synonym for the `s3` flavor)
@@ -156,9 +157,9 @@ When using the `config_sample.yml`, you can pass all options through as environm
156157
1. `boto_host`/`boto_port`: If you are using `storage: s3` the
157158
[standard boto config file locations](http://docs.pythonboto.org/en/latest/boto_config_tut.html#details)
158159
(`/etc/boto.cfg, ~/.boto`) will be used. If you are using a
159-
*non*-Amazon S3-compliant object store, in one of the boto config files'
160+
*non*-Amazon S3-compliant object store (such as Ceph), in one of the boto config files'
160161
`[Credentials]` section, set `boto_host`, `boto_port` as appropriate for the
161-
service you are using.
162+
service you are using. Alternatively, set `boto_host` and `boto_port` in the config file.
162163
1. `bugsnag`: The bugsnag API key (note that if you don't use the official docker container, you need to install the registry with bugsnag enabled: `pip install docker-registry[bugsnag]`)
163164
164165
### Authentication options
@@ -184,7 +185,7 @@ When using the `config_sample.yml`, you can pass all options through as environm
184185
##### Generating keys with `openssl`
185186
186187
You will need to install the python-rsa package (`pip install rsa`) in addition to using `openssl`.
187-
Generating the public key using openssl will lead to producing a key in a format not supported by
188+
Generating the public key using openssl will lead to producing a key in a format not supported by
188189
the RSA library the registry is using.
189190
190191
Generate private key:
@@ -204,7 +205,7 @@ can configure the backend with a configuration like:
204205
205206
The `search_backend` setting selects the search backend to use. If
206207
`search_backend` is empty, no index is built, and the search endpoint always
207-
returns empty results.
208+
returns empty results.
208209
209210
1. `search_backend`: The name of the search backend engine to use.
210211
Currently supported backends are:
@@ -352,7 +353,11 @@ AWS Simple Storage Service options
352353
server-side by S3 and will be stored in an encrypted form while at rest
353354
in S3.
354355
1. `s3_secure`: boolean, true for HTTPS to S3
355-
1. `boto_bucket`: string, the bucket name
356+
1. `boto_bucket`: string, the bucket name for *non*-Amazon S3-compliant object store
357+
1. `boto_host`: string, host for *non*-Amazon S3-compliant object store
358+
1. `boto_port`: for *non*-Amazon S3-compliant object store
359+
1. `boto_debug`: for *non*-Amazon S3-compliant object store
360+
1. `boto_calling_format`: for *non*-Amazon S3-compliant object store
356361
1. `storage_path`: string, the sub "folder" where image data will be stored.
357362

358363
Example:
@@ -391,6 +396,26 @@ docker run \
391396
NOTE: The container will try to allocate the port 5000. If the port
392397
is already taken, find out which container is already using it by running `docker ps`
393398
399+
### Other *non*-Amazon S3-compliant object store (e.g. Ceph and Riak CS)
400+
401+
```
402+
docker run \
403+
-e SETTINGS_FLAVOR=s3 \
404+
-e AWS_BUCKET=mybucket \
405+
-e STORAGE_PATH=/registry \
406+
-e AWS_KEY=myawskey \
407+
-e AWS_SECRET=myawssecret \
408+
-e SEARCH_BACKEND=sqlalchemy \
409+
-p 5000:5000 \
410+
-p AWS_HOST=myowns3.com \
411+
-p AWS_SECURE=false \
412+
-p AWS_ENCRYPT=false \
413+
-p AWS_PORT=80 \
414+
-p AWS_DEBUG=true \
415+
-p AWS_CALLING_FORMAT=OrdinaryCallingFormat \
416+
registry
417+
```
418+
394419
### Advanced: install the registry on an existing server
395420
396421
#### On Ubuntu
@@ -454,7 +479,7 @@ behind a nginx server which supports chunked transfer-encoding (nginx >= 1.3.9).
454479
455480
#### nginx
456481
457-
[Here is an nginx configuration file example.](https://github.com/docker/docker-registry/blob/master/contrib/nginx/nginx.conf), which applies to versions < 1.3.9 which are compiled with the [HttpChunkinModule](http://wiki.nginx.org/HttpChunkinModule).
482+
[Here is an nginx configuration file example.](https://github.com/docker/docker-registry/blob/master/contrib/nginx/nginx.conf), which applies to versions < 1.3.9 which are compiled with the [HttpChunkinModule](http://wiki.nginx.org/HttpChunkinModule).
458483
459484
[This is another example nginx configuration file](https://github.com/docker/docker-registry/blob/master/contrib/nginx/nginx_1-3-9.conf) that applies to versions of nginx greater than 1.3.9 that have support for the chunked_transfer_encoding directive.
460485

config/config_sample.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,26 @@ s3: &s3
8484
s3_secure: _env:AWS_SECURE:true
8585
s3_access_key: _env:AWS_KEY
8686
s3_secret_key: _env:AWS_SECRET
87+
boto_host: _env:AWS_HOST
88+
boto_port: _env:AWS_PORT
89+
90+
# Ceph Object Gateway Configuration
91+
# See http://ceph.com/docs/master/radosgw/ for details on installing this service.
92+
ceph-s3: &ceph-s3
93+
<<: *common
94+
storage: s3
95+
s3_region: ~
96+
s3_bucket: _env:AWS_BUCKET
97+
s3_encrypt: _env:AWS_ENCRYPT:false
98+
s3_secure: _env:AWS_SECURE:false
99+
storage_path: _env:STORAGE_PATH:/registry
100+
s3_access_key: _env:AWS_KEY
101+
s3_secret_key: _env:AWS_SECRET
102+
boto_bucket: _env:AWS_BUCKET
103+
boto_host: _env:AWS_HOST
104+
boto_port: _env:AWS_PORT
105+
boto_debug: _env:AWS_DEBUG:0
106+
boto_calling_format: _env:AWS_CALLING_FORMAT
87107

88108
# Google Cloud Storage Configuration
89109
# See:

depends/docker-registry-core/docker_registry/core/boto.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@ def _build_connection_params(self):
139139
config_args = [
140140
'host', 'port', 'debug',
141141
'proxy', 'proxy_port',
142-
'proxy_user', 'proxy_pass'
142+
'proxy_user', 'proxy_pass',
143+
'calling_format'
143144
]
144145
for arg in config_args:
145146
confkey = 'boto_' + arg

0 commit comments

Comments
 (0)