#!/bin/bash
NAME=registry
IMAGE=registry:2
BUCKET=my-docker-registry-bucket
BUCKET_PATH=/docker/registry
AWS_KEY=********************
AWS_SECRET=********************
AWS_REGION=eu-west-1
# docker kill $NAME
# docker rm $NAME
docker run \
-e REGISTRY_STORAGE=s3 \
-e REGISTRY_STORAGE_S3_REGION=$AWS_REGION \
-e REGISTRY_STORAGE_S3_BUCKET=$BUCKET \
-e REGISTRY_STORAGE_S3_ACCESSKEY=$AWS_KEY \
-e REGISTRY_STORAGE_S3_SECRETKEY=$AWS_SECRET \
-d -p 80:5000 $IMAGE
# -e DEBUG=True \
# -e LOGLEVEL=debug \
run the script above and test with:
docker pull busybox
docker tag busybox localhost:80/test:1
docker push localhost:80/test:1
Kudos to http://romain.dorgueil.net/blog/en/docker/2014/12/21/docker-registry-amazon-s3-storage-backend.html and http://stackoverflow.com/questions/30177828/docker-registry2-0-overriding-configuration-options for the info