forked from paulczar/docker-percona_galera
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
65 lines (51 loc) · 1.71 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
60
61
62
63
64
65
# This file creates a container that runs Database (Percona) with Galera Replication.
#
# Author: Paul Czarkowski
# Date: 08/16/2014
FROM ubuntu:trusty
MAINTAINER Paul Czarkowski "[email protected]"
# Base Deps
RUN \
apt-get update && apt-get install -yq \
make \
ca-certificates \
net-tools \
sudo \
wget \
vim \
strace \
lsof \
netcat \
lsb-release \
locales \
socat \
--no-install-recommends
# generate a local to suppress warnings
RUN locale-gen en_US.UTF-8
RUN \
apt-key adv --keyserver keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A || \
apt-key adv --keyserver hkp://keys.gnupg.net:80 --recv-keys 1C4CBDCDCD2EFD2A
RUN \
echo "deb http://repo.percona.com/apt `lsb_release -cs` main" > /etc/apt/sources.list.d/percona.list && \
echo "deb-src http://repo.percona.com/apt `lsb_release -cs` main" >> /etc/apt/sources.list.d/percona.list && \
ln -fs /bin/true /usr/bin/chfn && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y percona-xtradb-cluster-client-5.6 percona-xtradb-cluster-server-5.6 percona-xtrabackup rsync percona-xtradb-cluster-garbd-3.x haproxy && \
sed -i 's/^\(bind-address\s.*\)/# \1/' /etc/mysql/my.cnf
RUN rm -rf /var/lib/mysql/*
# download latest stable etcdctl
ADD https://s3-us-west-2.amazonaws.com/opdemand/etcdctl-v0.4.5 /usr/local/bin/etcdctl
RUN chmod +x /usr/local/bin/etcdctl
# install confd
ADD https://s3-us-west-2.amazonaws.com/opdemand/confd-v0.5.0-json /usr/local/bin/confd
RUN chmod +x /usr/local/bin/confd
# Define mountable directories.
VOLUME ["/var/lib/mysql"]
ADD . /app
# Define working directory.
WORKDIR /app
RUN chmod +x /app/bin/*
# Define default command.
CMD ["/app/bin/boot"]
# Expose ports.
EXPOSE 3306 4444 4567 4568