-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile_mariadb
33 lines (26 loc) · 1.09 KB
/
Dockerfile_mariadb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
FROM yobasystems/alpine
#add testing repository
#COPY repositories /etc/apk/repositories
#RUN echo "@testing https://dl-4.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories
RUN echo "https://dl-4.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories
RUN apk -U add --no-cache mariadb mariadb-client pwgen bash nano unixodbc unixodbc-dev mariadb-connector-odbc && \
rm -f /var/cache/apk/*
ADD run-db.sh /scripts/run.sh
ADD install_odbc.sh /scripts/install_odbc.sh
RUN chmod +x /scripts/install_odbc.sh
#adds config to listen on all available interfaces
ADD mariadb-server.cnf /etc/my.cnf.d/mariadb-server.cnf
RUN mkdir /scripts/pre-exec.d && \
mkdir /scripts/pre-init.d && \
chmod -R 755 /scripts
COPY setup.sql /docker-entrypoint-initdb.d/setup.sql
COPY tables.sql /docker-entrypoint-initdb.d/tables.sql
ARG ODBC_HOST=$ODBC_HOST \
ODBC_PORT=$ODBC_PORT \
MYSQL_DATABASE=$MYSQL_DATABASE \
MYSQL_USER=$MYSQL_USER \
MYSQL_PASSWORD=$MYSQL_PASSWORD \
MYSQL_ROOT_PASSWORD=$MYSQL_ROOT_PASSWORD
RUN /scripts/install_odbc.sh
EXPOSE 3306
ENTRYPOINT ["/scripts/run.sh"]