-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
executable file
·71 lines (66 loc) · 2.2 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
66
67
68
69
70
71
FROM centos:centos7
ENV MARIADB_SERVER_VERSION 10.6
# Build-time metadata as defined at http://label-schema.org
ARG BUILD_DATE
ARG VCS_REF
ARG VERSION
LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.name="mariadb-server" \
org.label-schema.description="MariaDB 10.6 Server" \
org.label-schema.url="https://mariadb.com/kb/en/mariadb-1060-release-notes/" \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vcs-url="https://github.com/kesterriley/mariadb-server-dockerfile" \
org.label-schema.vendor="Kester Riley" \
org.label-schema.version=$VERSION \
org.label-schema.schema-version="1.0" \
maintainer="Kester Riley <kesterriley@hotmail.com>" \
architecture="AMD64/x86_64" \
mariadbVersion=$MARIADB_SERVER_VERSION
RUN set -x \
&& groupadd -r mysql && useradd -r -g mysql mysql \
&& yum update -y \
&& yum install -y epel-release \
&& yum install -y \
wget \
curl \
nmap \
pigz \
pv \
iproute \
socat \
bind-utils \
pwgen \
psmisc \
hostname \
which \
&& rm -rf /tmp/* \
&& mkdir /etc/my.cnf.d \
&& curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | bash -s -- --mariadb-server-version="mariadb-$MARIADB_SERVER_VERSION" \
&& yum install -y \
MariaDB-server \
MariaDB-client \
galera-4 \
MariaDB-shared \
MariaDB-backup \
&& yum clean all \
&& rm -rf /var/cache/yum
COPY bin/*.sh /usr/local/bin/
COPY my.cnf /etc/
RUN set -ex \
&& mkdir -p /etc/my.cnf.d \
&& chown -R root:root /etc/my.cnf.d \
&& chown -R root:root /etc/my.cnf \
&& chmod -R 644 /etc/my.cnf.d \
&& chmod -R 644 /etc/my.cnf \
&& chmod -R 777 /usr/local/bin/*.sh \
&& sed -i '$d' /etc/passwd \
&& rm -rf /var/lib/mysql \
&& chmod g=u /etc/passwd \
&& find /etc/my.cnf.d/ -name '*.cnf' -print0 \
| xargs -0 grep -lZE '^(bind-address|log)' \
| xargs -rt -0 sed -Ei 's/^(bind-address|log)/#&/' \
&& /usr/local/bin/fix-permissions.sh /var/lib/ \
&& /usr/local/bin/fix-permissions.sh /var/run/
USER 100020100
STOPSIGNAL SIGTERM
ENTRYPOINT ["start.sh"]