github.com/technosophos/deis@v1.7.1-0.20150915173815-f9005256004b/database/build.sh (about) 1 #!/usr/bin/env bash 2 3 # fail on any command exiting non-zero 4 set -eo pipefail 5 6 if [[ -z $DOCKER_BUILD ]]; then 7 echo 8 echo "Note: this script is intended for use by the Dockerfile and not as a way to build the database locally" 9 echo 10 exit 1 11 fi 12 13 apk add --update-cache \ 14 build-base \ 15 curl \ 16 file \ 17 gcc \ 18 git \ 19 libffi-dev \ 20 libxml2-dev \ 21 libxslt-dev \ 22 openssl-dev \ 23 postgresql \ 24 postgresql-client \ 25 python-dev 26 27 # pv port. 28 curl http://dl-3.alpinelinux.org/alpine/edge/testing/x86_64/pv-1.6.0-r0.apk -o /tmp/pv-1.6.0-r0.apk 29 apk add /tmp/pv-1.6.0-r0.apk 30 31 /etc/init.d/postgresql stop || true 32 33 # install pip 34 curl -sSL https://raw.githubusercontent.com/pypa/pip/7.0.3/contrib/get-pip.py | python - 35 36 # install wal-e 37 pip install --disable-pip-version-check --no-cache-dir wal-e==0.8.1 oslo.config>=1.12.0 38 39 # python port of daemontools 40 pip install --disable-pip-version-check --no-cache-dir envdir 41 42 mkdir -p /etc/wal-e.d/env /etc/postgresql/main /var/lib/postgresql 43 44 chown -R root:postgres /etc/wal-e.d /etc/postgresql/main /var/lib/postgresql 45 46 # cleanup. 47 apk del --purge \ 48 build-base \ 49 gcc \ 50 git 51 rm -rf /root/.cache \ 52 /usr/share/doc \ 53 /tmp/* \ 54 /var/cache/apk/*