-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathDockerfile
35 lines (29 loc) · 1 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
#
# Percona Server Dockerfile
#
# https://github.com/dockerfile/percona
#
# Pull base image.
FROM dockerfile/ubuntu
# Install Percona Server.
RUN \
apt-key adv --keyserver keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A && \
echo "deb http://repo.percona.com/apt `lsb_release -cs` main" > /etc/apt/sources.list.d/percona.list && \
apt-get update && \
apt-get install -y percona-server-server-5.6 && \
rm -rf /var/lib/apt/lists/* && \
sed -i 's/^\(bind-address\s.*\)/# \1/' /etc/mysql/my.cnf && \
sed -i 's/^\(log_error\s.*\)/# \1/' /etc/mysql/my.cnf && \
echo "mysqld_safe &" > /tmp/config && \
echo "mysqladmin --silent --wait=30 ping || exit 1" >> /tmp/config && \
echo "mysql -e 'GRANT ALL PRIVILEGES ON *.* TO \"root\"@\"%\" WITH GRANT OPTION;'" >> /tmp/config && \
bash /tmp/config && \
rm -f /tmp/config
# Define mountable directories.
VOLUME ["/etc/mysql", "/var/lib/mysql"]
# Define working directory.
WORKDIR /data
# Define default command.
CMD ["mysqld_safe"]
# Expose ports.
EXPOSE 3306