forked from certusoft/mysql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
59 lines (53 loc) · 2.57 KB
/
Dockerfile
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
57
58
59
FROM percona:5.7
# By keeping a lot of discrete steps in a single RUN we can clean up after
# ourselves in the same layer. This is gross but it saves ~100MB in the image
# 1. get Python drivers MySQL, Consul, and Manta
# 2. Add Consul from https://releases.hashicorp.com/consul
# 3. clean up to minimize image layer size
RUN set -ex \
&& export buildDeps='python-dev gcc unzip' \
&& export runDeps='python curl libffi-dev libssl-dev percona-xtrabackup-24 ca-certificates qpress' \
&& apt-get update \
&& apt-get install -y $buildDeps $runDeps --no-install-recommends \
&& curl -Lsfo /tmp/mysql-connector.deb http://dev.mysql.com/get/Downloads/Connector-Python/mysql-connector-python_2.1.7-1debian8.2_all.deb \
&& dpkg -i /tmp/mysql-connector.deb \
&& curl -Lsfo /tmp/mysql-utils.deb http://dev.mysql.com/get/Downloads/MySQLGUITools/mysql-utilities_1.6.5-1debian8_all.deb \
&& dpkg -i /tmp/mysql-utils.deb \
&& curl -Lsfo get-pip.py https://bootstrap.pypa.io/get-pip.py \
&& python get-pip.py \
&& pip install \
python-Consul==1.0.0 \
manta==2.5.0 \
minio==2.2.4 \
mock==2.0.0 \
json5==0.2.4 \
&& export CONSUL_SHA256=09c40c8b5be868003810064916d8460bff334ccfb59a5046390224b27e052c45 \
&& export CONSUL_VERSION=1.1.0 \
&& curl -Lsfo /tmp/consul.zip https://releases.hashicorp.com/consul/${CONSUL_VERSION}/consul_${CONSUL_VERSION}_linux_amd64.zip \
&& echo "${CONSUL_SHA256} /tmp/consul.zip" | sha256sum -c \
&& unzip /tmp/consul.zip -d /usr/local/bin \
&& rm /tmp/consul.zip \
&& mkdir /config \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get purge -y --auto-remove $buildDeps \
&& rm /tmp/mysql-connector.deb \
&& rm /tmp/mysql-utils.deb \
&& rm /get-pip.py \
&& rm /docker-entrypoint.sh
ENV CONTAINERPILOT_VER 3.8.0
ENV CONTAINERPILOT /etc/containerpilot.json5
# Add ContainerPilot
RUN set -ex \
&& export CONTAINERPILOT_CHECKSUM=84642c13683ddae6ccb63386e6160e8cb2439c26 \
&& curl -Lsfo /tmp/containerpilot.tar.gz "https://github.com/joyent/containerpilot/releases/download/${CONTAINERPILOT_VER}/containerpilot-${CONTAINERPILOT_VER}.tar.gz" \
&& echo "${CONTAINERPILOT_CHECKSUM} /tmp/containerpilot.tar.gz" | sha1sum -c \
&& tar zxf /tmp/containerpilot.tar.gz -C /usr/local/bin \
&& rm /tmp/containerpilot.tar.gz
# configure ContainerPilot and MySQL
COPY etc/* /etc/
COPY bin/manager /usr/local/bin/manager
COPY bin/test.py /usr/local/bin/test.py
COPY bin/manage.py /usr/local/bin/manage.py
# override the parent entrypoint
ENTRYPOINT []
CMD ["/usr/local/bin/containerpilot"]