docker-mariadb/Dockerfile
2025-07-09 21:39:36 +01:00

43 lines
1.1 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.

# syntax=docker/dockerfile:1
FROM ghcr.io/linuxserver/baseimage-alpine:3.22
# set version label
ARG BUILD_DATE
ARG VERSION
ARG MARIADB_VERSION
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="thelamer,nemchik"
# environment variables
ENV MYSQL_DIR="/config"
ENV DATADIR="$MYSQL_DIR/databases"
RUN \
echo "**** install runtime packages ****" && \
if [ -z ${MARIADB_VERSION+x} ]; then \
MARIADB_VERSION=$(curl -sL "http://dl-cdn.alpinelinux.org/alpine/v3.22/main/x86_64/APKINDEX.tar.gz" | tar -xz -C /tmp \
&& awk '/^P:mariadb$/,/V:/' /tmp/APKINDEX | sed -n 2p | sed 's/^V://'); \
fi && \
apk add --no-cache \
gnupg \
logrotate \
mariadb==${MARIADB_VERSION} \
mariadb-backup==${MARIADB_VERSION} \
mariadb-client==${MARIADB_VERSION} \
mariadb-common==${MARIADB_VERSION} \
mariadb-server-utils==${MARIADB_VERSION} && \
printf "Linuxserver.io version: ${VERSION}\nBuild-date: ${BUILD_DATE}" > /build_version && \
echo "**** cleanup ****" && \
rm -rf \
/tmp/* \
$HOME/.cache
# copy local files
COPY root/ /
# ports and volumes
EXPOSE 3306
VOLUME /config