Migrate MariaDB to S6 supervisor
This commit is contained in:
parent
6111c3be7c
commit
887b99c63b
@ -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"]
|
||||||
|
3
mariadb/docker/etc/services.d/.s6-svscan/finish
Executable file
3
mariadb/docker/etc/services.d/.s6-svscan/finish
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
/bin/true
|
5
mariadb/docker/etc/services.d/mariadb/run
Executable file
5
mariadb/docker/etc/services.d/mariadb/run
Executable file
@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/execlineb -P
|
||||||
|
|
||||||
|
fdmove -c 2 1
|
||||||
|
s6-setuidgid 3306:3306
|
||||||
|
/usr/bin/mysqld
|
Loading…
Reference in New Issue
Block a user