docker-mariadb/Dockerfile
2019-01-26 22:02:34 -08:00

51 lines
1.4 KiB
Docker
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

FROM lsiobase/ubuntu:bionic
# set version label
ARG BUILD_DATE
ARG VERSION
ARG MARIADB_VERSION
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="sparklyballs"
# environment variables
ARG DEBIAN_FRONTEND="noninteractive"
ENV MYSQL_DIR="/config"
ENV DATADIR=$MYSQL_DIR/databases
RUN \
echo "**** install gnupg ****" && \
apt-get update && \
apt-get install -y \
gnupg && \
echo "add mariadb repository ****" && \
echo "(redundant on armhf platform, but added for consistent dockerfile on all platforms) ****" && \
apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8 && \
echo "deb http://mirror.sax.uk.as61049.net/mariadb/repo/10.3/ubuntu bionic main" >> \
/etc/apt/sources.list.d/mariadb.list && \
echo "deb-src http://mirror.sax.uk.as61049.net/mariadb/repo/10.3/ubuntu bionic main" >> \
/etc/apt/sources.list.d/mariadb.list && \
echo "**** install runtime packages ****" && \
if [ -z ${MARIADB_VERSION+x} ]; then \
MARIADB="mariadb-server"; \
else \
MARIADB="mariadb-server=${MARIADB_VERSION}"; \
fi && \
apt-get update && \
apt-get install -y \
${MARIADB} && \
echo "**** cleanup ****" && \
rm -rf \
/tmp/* \
/var/lib/apt/lists/* \
/var/lib/mysql \
/var/tmp/* && \
mkdir -p \
/var/lib/mysql
# add local files
COPY root/ /
# ports and volumes
EXPOSE 3306
VOLUME /config