-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathDockerfile
34 lines (28 loc) · 1001 Bytes
/
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
#
# MariaDB Dockerfile
#
# https://github.com/dockerfile/mariadb
#
# Pull base image.
FROM dockerfile/ubuntu
# Install MariaDB.
RUN \
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0xcbcb082a1bb943db && \
echo "deb http://mariadb.mirror.iweb.com/repo/10.0/ubuntu `lsb_release -cs` main" > /etc/apt/sources.list.d/mariadb.list && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y mariadb-server && \
rm -rf /var/lib/apt/lists/* && \
sed -i 's/^\(bind-address\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