all three containers works with alpine and user are configured
This commit is contained in:
@@ -2,10 +2,6 @@
|
||||
|
||||
# FROM debian:buster
|
||||
#
|
||||
# ARG DB_NAME
|
||||
# ARG DB_USER
|
||||
# ARG DB_PSWD
|
||||
#
|
||||
# RUN apt update && apt install -y \
|
||||
# mariadb-client \
|
||||
# mariadb-server \
|
||||
@@ -19,10 +15,6 @@
|
||||
|
||||
FROM alpine:3.15
|
||||
|
||||
ARG DB_NAME
|
||||
ARG DB_USER
|
||||
ARG DB_PSWD
|
||||
|
||||
# vim and bash for debug
|
||||
RUN apk update && apk add \
|
||||
mariadb \
|
||||
@@ -36,6 +28,10 @@
|
||||
|
||||
# common -----------------------------------------------------
|
||||
|
||||
ARG DB_NAME
|
||||
ARG DB_USER
|
||||
ARG DB_PSWD
|
||||
|
||||
# init mysql database
|
||||
RUN mysql_install_db --user=mysql --ldata=/var/lib/mysql && \
|
||||
mkdir -p /var/run/mysqld && \
|
||||
@@ -43,6 +39,9 @@ RUN mysql_install_db --user=mysql --ldata=/var/lib/mysql && \
|
||||
|
||||
# configure wp database
|
||||
COPY ./conf/create_db.sql /usr/bin/create_db.sql
|
||||
RUN sed -i "s/\${DB_NAME}/${DB_NAME}/g" /usr/bin/create_db.sql
|
||||
RUN sed -i "s/\${DB_USER}/${DB_USER}/g" /usr/bin/create_db.sql
|
||||
RUN sed -i "s/\${DB_PSWD}/${DB_PSWD}/g" /usr/bin/create_db.sql
|
||||
|
||||
ENTRYPOINT [ "mysqld", "--user=mysql", "--init-file=/usr/bin/create_db.sql" ]
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
# < socket=/var/lib/mysql/mysql.sock
|
||||
# >
|
||||
|
||||
|
||||
#
|
||||
# These groups are read by MariaDB server.
|
||||
# Use it for options that only the server (but not clients) should see
|
||||
@@ -27,7 +26,7 @@
|
||||
skip-networking = false
|
||||
datadir = /var/lib/mysql
|
||||
port = 3306
|
||||
socket=/var/lib/mysql/mysql.sock
|
||||
socket=/run/mysqld/mysqld.sock
|
||||
|
||||
# Galera-related settings
|
||||
[galera]
|
||||
|
||||
Reference in New Issue
Block a user