Migrate MariaDB to S6 supervisor

This commit is contained in:
Disassembler 2018-04-29 21:48:14 +02:00
parent 6111c3be7c
commit 887b99c63b
No known key found for this signature in database
GPG Key ID: 524BD33A0EE29499
3 changed files with 15 additions and 2 deletions

View File

@ -6,9 +6,14 @@ RUN \
addgroup -S -g 3306 mysql \ addgroup -S -g 3306 mysql \
&& adduser -S -u 3306 -h /var/lib/mysql -s /bin/nologin -g mysql -G mysql mysql \ && adduser -S -u 3306 -h /var/lib/mysql -s /bin/nologin -g mysql -G mysql mysql \
# Install MariaDB # Install MariaDB
&& apk --no-cache add mariadb mariadb-client && apk --no-cache add mariadb mariadb-client s6 \
# Create socket directory
&& mkdir /run/mysqld \
&& chown mysql:mysql /run/mysqld
COPY docker/ /
VOLUME ["/etc/mysql", "/var/lib/mysql"] VOLUME ["/etc/mysql", "/var/lib/mysql"]
EXPOSE 3306 EXPOSE 3306
CMD ["mysqld_safe"] CMD ["s6-svscan", "/etc/services.d"]

View File

@ -0,0 +1,3 @@
#!/bin/sh
/bin/true

View File

@ -0,0 +1,5 @@
#!/bin/execlineb -P
fdmove -c 2 1
s6-setuidgid 3306:3306
/usr/bin/mysqld