File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,35 +13,8 @@ RUN curl -sSL -o /usr/local/bin/etcdctl https://s3-us-west-2.amazonaws.com/opdem
1313RUN curl -sSL -o /usr/local/bin/confd https://s3-us-west-2.amazonaws.com/opdemand/confd-v0.5.0-json \
1414 && chmod +x /usr/local/bin/confd
1515
16- # install postgresql 9.3 from postgresql.org repository as well as requirements for building wal-e
17- RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main" > /etc/apt/sources.list.d/pgdg.list
18- RUN curl -sk https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
19- RUN apt-get update && apt-get install -yq \
20- curl \
21- daemontools \
22- file \
23- gcc \
24- git \
25- libxml2-dev \
26- libxslt1-dev \
27- lzop \
28- postgresql-9.3 \
29- pv \
30- python-dev
31-
32- RUN /etc/init.d/postgresql stop
33-
34- # install pip
35- RUN curl -sSL https://raw.githubusercontent.com/pypa/pip/1.5.6/contrib/get-pip.py | python -
36-
37- # install wal-e
38- WORKDIR /tmp
39- RUN git clone https://github.com/wal-e/wal-e.git
40- WORKDIR /tmp/wal-e
41- RUN git checkout c6f0d02
42- RUN pip install .
43- RUN mkdir -p /etc/wal-e.d/env
44- RUN chown -R root:postgres /etc/wal-e.d
16+ ADD build.sh /tmp/build.sh
17+ RUN DOCKER_BUILD=true /tmp/build.sh
4518
4619# define the execution environment
4720WORKDIR /app
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ if [[ -z $DOCKER_BUILD ]]; then
4+ echo
5+ echo " Note: this script is intended for use by the Dockerfile and not as a way to build the database locally"
6+ echo
7+ exit 1
8+ fi
9+
10+ # install postgresql 9.3 from postgresql.org repository as well as requirements for building wal-e
11+ echo " deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main" > /etc/apt/sources.list.d/pgdg.list
12+ curl -sk https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
13+ apt-get update && apt-get install -yq \
14+ curl \
15+ daemontools \
16+ file \
17+ gcc \
18+ git \
19+ libxml2-dev \
20+ libxslt1-dev \
21+ lzop \
22+ postgresql-9.3 \
23+ pv \
24+ python-dev
25+
26+ /etc/init.d/postgresql stop
27+
28+ # install pip
29+ curl -sSL https://raw.githubusercontent.com/pypa/pip/1.5.6/contrib/get-pip.py | python -
30+
31+ # install wal-e
32+ cd /tmp
33+ git clone https://github.com/wal-e/wal-e.git
34+
35+ cd /tmp/wal-e
36+ git checkout c6f0d02
37+
38+ pip install .
39+
40+ mkdir -p /etc/wal-e.d/env
41+
42+ chown -R root:postgres /etc/wal-e.d
43+
44+ # cleanup. indicate that python, libpq and libyanl are required packages.
45+ apt-mark unmarkauto python curl daemontools file libxml2-dev \
46+ libxslt1-dev lzop postgresql-9.3 pv && \
47+ apt-get remove -y --purge python-dev gcc cpp libpq-dev libyaml-dev git && \
48+ apt-get autoremove -y --purge && \
49+ apt-get clean -y && \
50+ rm -Rf /usr/share/man /usr/share/doc && \
51+ rm -rf /tmp/* /var/tmp/* && \
52+ rm -rf /var/lib/apt/lists/*
You can’t perform that action at this time.
0 commit comments