|
| 1 | +#!/usr/bin/env bash |
| 2 | + |
| 3 | +DEBIAN_FRONTEND=noninteractive |
| 4 | + |
| 5 | +sed -i 's/main$/main universe/' /etc/apt/sources.list |
| 6 | + |
| 7 | +# install required packages (copied from dotcloud/docker-registry Dockerfile) |
| 8 | +apt-get install -y git-core build-essential python-dev \ |
| 9 | + libevent-dev python-openssl liblzma-dev |
| 10 | + |
| 11 | +# install pip |
| 12 | +curl -sSL https://raw.githubusercontent.com/pypa/pip/1.5.6/contrib/get-pip.py | python - |
| 13 | + |
| 14 | +# create a registry user |
| 15 | +useradd -s /bin/bash registry |
| 16 | + |
| 17 | +# add the docker registry source from github |
| 18 | +git clone https://github.com/deis/docker-registry /docker-registry && \ |
| 19 | + cd /docker-registry && \ |
| 20 | + git checkout 94e7707 && \ |
| 21 | + chown -R registry:registry /docker-registry |
| 22 | + |
| 23 | +# install boto configuration |
| 24 | +cp /docker-registry/config/boto.cfg /etc/boto.cfg |
| 25 | +cd /docker-registry && pip install -r requirements/main.txt |
| 26 | + |
| 27 | +# Install core |
| 28 | +pip install /docker-registry/depends/docker-registry-core |
| 29 | + |
| 30 | +# Install registry |
| 31 | +pip install file:///docker-registry#egg=docker-registry[bugsnag,newrelic,cors] |
| 32 | + |
| 33 | +# cleanup. indicate that python is a required package. |
| 34 | +apt-mark unmarkauto python python-openssl && \ |
| 35 | + apt-get remove -y --purge git-core build-essential python-dev && \ |
| 36 | + apt-get autoremove -y --purge && \ |
| 37 | + apt-get clean -y && \ |
| 38 | + rm -Rf /usr/share/man /usr/share/doc && \ |
| 39 | + rm -rf /tmp/* /var/tmp/* && \ |
| 40 | + rm -rf /var/lib/apt/lists/* |
0 commit comments