From 67dc814aca00686c4ca3e92af19eaeeb09165e2f Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Fri, 24 Nov 2023 16:40:29 +0000 Subject: [PATCH] Allow customising the extra modules that the container is built with. --- Dockerfile | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 689a3c4..aa97b1f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,11 +3,12 @@ FROM alpine:3.18 LABEL org.opencontainers.image.authors="Anope Team " ARG VERSION=2.0 -ARG RUN_DEPENDENCIES= -ARG BUILD_DEPENDENCIES= +ARG RUN_DEPENDENCIES="gnutls gnutls-utils mariadb-client mariadb-connector-c sqlite-libs" +ARG BUILD_DEPENDENCIES="gnutls-dev mariadb-dev sqlite-dev" +ARG EXTRA_MODULES="m_mysql m_sqlite m_ssl_gnutls" -RUN apk add --no-cache --virtual .build-utils gcc g++ ninja git cmake gnutls-dev sqlite-dev mariadb-dev $BUILD_DEPENDENCIES && \ - apk add --no-cache --virtual .dependencies libgcc libstdc++ gnutls gnutls-utils sqlite-libs mariadb-client mariadb-connector-c $RUN_DEPENDENCIES && \ +RUN apk add --no-cache --virtual .build-utils gcc g++ ninja git cmake $BUILD_DEPENDENCIES && \ + apk add --no-cache --virtual .dependencies libgcc libstdc++ $RUN_DEPENDENCIES && \ # Create a user to run anope later adduser -u 10000 -h /anope/ -D -S anope && \ mkdir -p /src && \ @@ -16,9 +17,7 @@ RUN apk add --no-cache --virtual .build-utils gcc g++ ninja git cmake gnutls-dev git clone --depth 1 https://github.com/anope/anope.git anope -b $VERSION && \ cd /src/anope && \ # Add and overwrite modules - ln -s /src/anope/modules/extra/m_ssl_gnutls.cpp modules && \ - ln -s /src/anope/modules/extra/m_mysql.cpp modules && \ - ln -s /src/anope/modules/extra/m_sqlite.cpp modules && \ + for module in $EXTRA_MODULES; do ln -s /src/anope/modules/extra/$module.cpp modules; done && \ mkdir build && \ cd /src/anope/build && \ cmake -DINSTDIR=/anope/ -DDEFUMASK=077 -DCMAKE_BUILD_TYPE=RELEASE -GNinja .. && \