This repository has been archived by the owner on Jul 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDockerfile
99 lines (90 loc) · 3.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
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
FROM jdeathe/centos-ssh:1.11.1
ARG RELEASE_VERSION="1.11.2"
# ------------------------------------------------------------------------------
# Base install of required packages
# ------------------------------------------------------------------------------
RUN yum -y install \
--setopt=tsflags=nodocs \
--disableplugin=fastestmirror \
mysql-5.1.73-8.el6_8 \
mysql-libs-5.1.73-8.el6_8 \
mysql-server-5.1.73-8.el6_8 \
&& yum versionlock add \
mysql* \
&& rm -rf /var/cache/yum/* \
&& yum clean all
# ------------------------------------------------------------------------------
# Copy files into place
# ------------------------------------------------------------------------------
ADD src /
# ------------------------------------------------------------------------------
# Provisioning
# - Replace placeholders with values in systemd service unit template
# - Set permissions
# ------------------------------------------------------------------------------
RUN sed -i \
-e "s~{{RELEASE_VERSION}}~${RELEASE_VERSION}~g" \
/etc/systemd/system/centos-ssh-mysql@.service \
&& chmod 600 \
/etc/my.cnf \
&& chmod 644 \
/etc/supervisord.d/{20-mysqld-bootstrap,50-mysqld-wrapper}.conf \
&& chmod 700 \
/usr/{bin/healthcheck,sbin/mysqld-{bootstrap,wrapper}}
EXPOSE 3306
# ------------------------------------------------------------------------------
# Set default environment variables
# ------------------------------------------------------------------------------
ENV \
ENABLE_MYSQLD_BOOTSTRAP="true" \
ENABLE_MYSQLD_WRAPPER="true" \
ENABLE_SSHD_BOOTSTRAP="false" \
ENABLE_SSHD_WRAPPER="false" \
MYSQL_INIT_LIMIT="10" \
MYSQL_INIT_SQL="" \
MYSQL_ROOT_PASSWORD="" \
MYSQL_ROOT_PASSWORD_HASHED="false" \
MYSQL_SUBNET="127.0.0.1" \
MYSQL_USER="" \
MYSQL_USER_DATABASE="" \
MYSQL_USER_PASSWORD="" \
MYSQL_USER_PASSWORD_HASHED="false" \
SYSTEM_TIMEZONE="UTC"
# -----------------------------------------------------------------------------
# Set image metadata
# -----------------------------------------------------------------------------
LABEL \
maintainer="James Deathe <james.deathe@gmail.com>" \
install="docker run \
--rm \
--privileged \
--volume /:/media/root \
jdeathe/centos-ssh-mysql:${RELEASE_VERSION} \
/usr/sbin/scmi install \
--chroot=/media/root \
--name=\${NAME} \
--tag=${RELEASE_VERSION} \
--setopt='--volume {{NAME}}.data-mysql:/var/lib/mysql'" \
uninstall="docker run \
--rm \
--privileged \
--volume /:/media/root \
jdeathe/centos-ssh-mysql:${RELEASE_VERSION} \
/usr/sbin/scmi uninstall \
--chroot=/media/root \
--name=\${NAME} \
--tag=${RELEASE_VERSION} \
--setopt='--volume {{NAME}}.data-mysql:/var/lib/mysql'" \
org.deathe.name="centos-ssh-mysql" \
org.deathe.version="${RELEASE_VERSION}" \
org.deathe.release="jdeathe/centos-ssh-mysql:${RELEASE_VERSION}" \
org.deathe.license="MIT" \
org.deathe.vendor="jdeathe" \
org.deathe.url="https://github.com/jdeathe/centos-ssh-mysql" \
org.deathe.description="MySQL 5.1 - CentOS-6 6.10 x86_64."
HEALTHCHECK \
--interval=1s \
--timeout=1s \
--retries=10 \
CMD ["/usr/bin/healthcheck"]
CMD ["/usr/bin/supervisord", "--configuration=/etc/supervisord.conf"]