-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
56 lines (43 loc) · 1.61 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/usr/bin/env bash
# fail on any command exiting non-zero
set -eo pipefail
if [[ -z $DOCKER_BUILD ]]; then
echo
echo "Note: this script is intended for use by the Dockerfile and not as a way to build the registry locally"
echo
exit 1
fi
# install required packages (copied from dotcloud/docker-registry Dockerfile)
apk add --update-cache \
build-base \
git \
openssl-dev \
python-dev \
libffi-dev \
swig \
libevent-dev \
xz-dev
# install pip
curl -sSL https://raw.githubusercontent.com/pypa/pip/7.0.3/contrib/get-pip.py | python -
pip install --upgrade pip
# workaround to python > 2.7.8 SSL issues
pip install --disable-pip-version-check --no-cache-dir pyopenssl ndg-httpsclient pyasn1
# add the docker registry source from github
wget -O - "https://github.com/docker/docker-registry/archive/0.9.1.tar.gz" | tar -xz && \
mv docker-registry-0.9.1 /docker-registry
# install boto configuration
cp /docker-registry/config/boto.cfg /etc/boto.cfg
cd /docker-registry && pip install --disable-pip-version-check --no-cache-dir -r requirements/main.txt
# Install core
pip install --disable-pip-version-check --no-cache-dir /docker-registry/depends/docker-registry-core
# Install registry
pip install --disable-pip-version-check --no-cache-dir "file:///docker-registry#egg=docker-registry[bugsnag,newrelic,cors]"
patch \
"$(python -c 'import boto; import os; print os.path.dirname(boto.__file__)')/connection.py" \
< /docker-registry/contrib/boto_header_patch.diff
# cleanup. indicate that python is a required package.
apk del --purge \
build-base \
linux-headers \
python-dev
rm -rf /var/cache/apk/*