21 lines
787 B
Docker
21 lines
787 B
Docker
FROM debian:buster
|
|
|
|
ARG DEBIAN_FRONTEND=noninteractive
|
|
|
|
# docker build --secret tag : https://docs.docker.com/develop/develop-images/build_enhancements/#new-docker-build-secret-information)
|
|
# use secret with docker : https://www.rockyourcode.com/using-docker-secrets-with-docker-compose/)
|
|
RUN --mount=type=secret,id=my_secret cat /run/secrets/my_secret.txt
|
|
#RUN cat /run/secrets/my_secret.txt
|
|
|
|
RUN apt update && \
|
|
apt install -y mariadb-client mariadb-server && \
|
|
rm -rf /var/lib/apt/lists/* && \
|
|
\
|
|
service mysql start && \
|
|
mariadb --execute="CREATE DATABASE db_hugo_test;" && \
|
|
mariadb --execute="CREATE USER 'u_hugo_test'@'localhost' IDENTIFIED BY 'hello';" && \
|
|
mariadb --execute="GRANT ALL PRIVILEGES ON *.* TO 'u_hugo_test'@'localhost' with grant option;"
|
|
|
|
CMD [ "mysqld" ]
|
|
|