From cecb8d7dbadf5891f89d2b01421d704d3fb48ce1 Mon Sep 17 00:00:00 2001 From: Disassembler Date: Thu, 13 Sep 2018 13:27:09 +0200 Subject: [PATCH] LXCize MariaDB build --- mariadb/Dockerfile | 19 ---------------- .../docker/etc/services.d/.s6-svscan/finish | 3 --- mariadb/docker/etc/services.d/mariadb/run | 5 ----- mariadb/lxcfile | 22 +++++++++++++++++++ mariadb/{build.sh => setup.sh} | 0 mariadb/{ => setup}/adminpwd.sql | 0 mariadb/{ => setup}/etc/init.d/mariadb | 0 mariadb/{ => setup}/srv/mariadb/conf/my.cnf | 0 8 files changed, 22 insertions(+), 27 deletions(-) delete mode 100644 mariadb/Dockerfile delete mode 100755 mariadb/docker/etc/services.d/.s6-svscan/finish delete mode 100755 mariadb/docker/etc/services.d/mariadb/run create mode 100644 mariadb/lxcfile rename mariadb/{build.sh => setup.sh} (100%) rename mariadb/{ => setup}/adminpwd.sql (100%) rename mariadb/{ => setup}/etc/init.d/mariadb (100%) rename mariadb/{ => setup}/srv/mariadb/conf/my.cnf (100%) diff --git a/mariadb/Dockerfile b/mariadb/Dockerfile deleted file mode 100644 index 16601de..0000000 --- a/mariadb/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM alpine -LABEL maintainer="Disassembler " - -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"] diff --git a/mariadb/docker/etc/services.d/.s6-svscan/finish b/mariadb/docker/etc/services.d/.s6-svscan/finish deleted file mode 100755 index 78d5fdc..0000000 --- a/mariadb/docker/etc/services.d/.s6-svscan/finish +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -/bin/true diff --git a/mariadb/docker/etc/services.d/mariadb/run b/mariadb/docker/etc/services.d/mariadb/run deleted file mode 100755 index a8d26ef..0000000 --- a/mariadb/docker/etc/services.d/mariadb/run +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/execlineb -P - -fdmove -c 2 1 -s6-setuidgid 3306:3306 -/usr/bin/mysqld diff --git a/mariadb/lxcfile b/mariadb/lxcfile new file mode 100644 index 0000000..7d8b46b --- /dev/null +++ b/mariadb/lxcfile @@ -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 diff --git a/mariadb/build.sh b/mariadb/setup.sh similarity index 100% rename from mariadb/build.sh rename to mariadb/setup.sh diff --git a/mariadb/adminpwd.sql b/mariadb/setup/adminpwd.sql similarity index 100% rename from mariadb/adminpwd.sql rename to mariadb/setup/adminpwd.sql diff --git a/mariadb/etc/init.d/mariadb b/mariadb/setup/etc/init.d/mariadb similarity index 100% rename from mariadb/etc/init.d/mariadb rename to mariadb/setup/etc/init.d/mariadb diff --git a/mariadb/srv/mariadb/conf/my.cnf b/mariadb/setup/srv/mariadb/conf/my.cnf similarity index 100% rename from mariadb/srv/mariadb/conf/my.cnf rename to mariadb/setup/srv/mariadb/conf/my.cnf