LXCize MariaDB build

This commit is contained in:
Disassembler 2018-09-13 13:27:09 +02:00
parent ce71447928
commit cecb8d7dba
Signed by: Disassembler
GPG Key ID: 524BD33A0EE29499
8 changed files with 22 additions and 27 deletions

View File

@ -1,19 +0,0 @@
FROM alpine
LABEL maintainer="Disassembler <disassembler@dasm.cz>"
RUN \
# Create OS user (which will be picked up later by apk add)
addgroup -S -g 3306 mysql \
&& adduser -S -u 3306 -h /var/lib/mysql -s /bin/false -g mysql -G mysql mysql \
# Install MariaDB
&& apk --no-cache add mariadb mariadb-client \
# Create socket directory
&& mkdir /run/mysqld \
&& chown mysql:mysql /run/mysqld
COPY docker/ /
VOLUME ["/etc/mysql", "/var/lib/mysql"]
EXPOSE 3306
CMD ["s6-svscan", "/etc/services.d"]

View File

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

View File

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

22
mariadb/lxcfile Normal file
View File

@ -0,0 +1,22 @@
IMAGE mariadb
LAYER shared/alpine
LAYER mariadb/mariadb
RUN EOF
# Create OS user (which will be picked up later by apk add)
addgroup -S -g 3306 mysql
adduser -S -u 3306 -h /var/lib/mysql -s /bin/false -g mysql -G mysql mysql
# Install MariaDB
apk --no-cache add mariadb mariadb-client
# Create socket directory
mkdir /run/mysqld
chown mysql:mysql /run/mysqld
EOF
MOUNT /srv/mariadb/conf etc/mysqld
MOUNT /srv/mariadb/data var/lib/mysql
USER 3306 3306
CMD /usr/bin/mysqld