From 5b0ffc8eabdb6739517cad94fc96e00acb913a90 Mon Sep 17 00:00:00 2001 From: Joxit Date: Mon, 15 Apr 2019 20:30:50 +0200 Subject: [PATCH] Add quick exemple for issue #75 --- examples/issue-75/README.md | 7 ++++ examples/issue-75/docker-compose.yml | 32 +++++++++++++++++ examples/issue-75/registry-config/config.yml | 37 ++++++++++++++++++++ examples/issue-75/s3-server-cmd | 6 ++++ 4 files changed, 82 insertions(+) create mode 100644 examples/issue-75/README.md create mode 100644 examples/issue-75/docker-compose.yml create mode 100644 examples/issue-75/registry-config/config.yml create mode 100755 examples/issue-75/s3-server-cmd diff --git a/examples/issue-75/README.md b/examples/issue-75/README.md new file mode 100644 index 0000000..f07d295 --- /dev/null +++ b/examples/issue-75/README.md @@ -0,0 +1,7 @@ +# Example for issue #75 + +Run this command `docker-compose up -d`, then you can push your images (e.g localhost:5000/alpine). + +Be careful, the docker registry is using status codes 307 for each requests, that means you must configure your s3 to accept same requests as your private registry (that means `DELETE`, `Access-Control-Allow-Origin` and others). + +This s3 server allow all requests. \ No newline at end of file diff --git a/examples/issue-75/docker-compose.yml b/examples/issue-75/docker-compose.yml new file mode 100644 index 0000000..33cc0c4 --- /dev/null +++ b/examples/issue-75/docker-compose.yml @@ -0,0 +1,32 @@ +version: '2.0' +services: + registry: + image: registry:2.7 + volumes: + - ./registry-data:/var/lib/registry + - ./registry-config/config.yml:/etc/docker/registry/config.yml + depends_on: + - s3-server + network_mode: host + + ui: + image: joxit/docker-registry-ui:static + ports: + - 80:80 + environment: + - URL=http://127.0.0.1:5000 + - DELETE_IMAGES=true + depends_on: + - registry + network_mode: host + + s3-server: + image: minio/minio:RELEASE.2019-04-09T01-22-30Z + volumes: + - ./s3-server-cmd:/bin/s3-server-cmd:ro + environment: + - MINIO_ACCESS_KEY=accessKey1 + - MINIO_SECRET_KEY=verySecretKey1 + - MINIO_REGION=us-east-1 + network_mode: host + entrypoint: /bin/s3-server-cmd diff --git a/examples/issue-75/registry-config/config.yml b/examples/issue-75/registry-config/config.yml new file mode 100644 index 0000000..508cdd6 --- /dev/null +++ b/examples/issue-75/registry-config/config.yml @@ -0,0 +1,37 @@ +version: 0.1 + +log: + level: debug + fields: + service: registry +storage: + delete: + enabled: true + cache: + blobdescriptor: inmemory + s3: + accesskey: accessKey1 + secretkey: verySecretKey1 + region: us-east-1 + regionendpoint: http://127.0.0.1:9000 + bucket: registry + encrypt: false + secure: false + v4auth: true + chunksize: 5242880 + rootdirectory: / +http: + addr: 0.0.0.0:5000 + headers: + X-Content-Type-Options: [nosniff] + Access-Control-Allow-Origin: ['http://127.0.0.1'] + Access-Control-Allow-Methods: ['HEAD', 'GET', 'OPTIONS', 'DELETE'] + Access-Control-Allow-Headers: ['Authorization'] + Access-Control-Max-Age: [1728000] + Access-Control-Allow-Credentials: [true] + Access-Control-Expose-Headers: ['Docker-Content-Digest'] +health: + storagedriver: + enabled: true + interval: 10s + threshold: 3 \ No newline at end of file diff --git a/examples/issue-75/s3-server-cmd b/examples/issue-75/s3-server-cmd new file mode 100755 index 0000000..8349ba7 --- /dev/null +++ b/examples/issue-75/s3-server-cmd @@ -0,0 +1,6 @@ +#!/bin/sh + +set -e + +mkdir -p /data/registry +minio server /data \ No newline at end of file