From 3f2359e692ec29ab1c45521a0cf30ea98ff141bb Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Thu, 6 Mar 2014 12:44:20 -0500 Subject: [PATCH] docker-registry on fedora --- Dockerfile | 8 ++++++++ run.sh | 24 ++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 Dockerfile create mode 100755 run.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..eb4b51a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,8 @@ +FROM fedora + +RUN yum install -y docker-registry +ADD run.sh /srv/run.sh + +EXPOSE 5000 +CMD "/srv/run.sh" + diff --git a/run.sh b/run.sh new file mode 100755 index 0000000..f77c2d1 --- /dev/null +++ b/run.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +if [[ -z "$GUNICORN_WORKERS" ]] ; then + GUNICORN_WORKERS=4 +fi + +if [[ -z "$REGISTRY_ADDRESS" ]] ; then + REGISTRY_ADDRESS=0.0.0.0 +fi + +if [[ -z "$REGISTRY_PORT" ]] ; then + REGISTRY_PORT=5000 +fi + +if [[ -z "$DOCKER_REGISTRY_CONFIG" ]] ; then + export DOCKER_REGISTRY_CONFIG=/etc/docker-registry.yml +fi + +if [[ -z "$SETTINGS_FLAVOR" ]] ; then + export SETTINGS_FLAVOR=local +fi + +cd /usr/lib/python2.7/site-packages/docker-registry +/usr/bin/gunicorn --access-logfile - --debug --max-requests 100 --graceful-timeout 3600 -t 3600 -k gevent -b ${REGISTRY_ADDRESS}:${REGISTRY_PORT} -w $GUNICORN_WORKERS wsgi:application