Skip to content

Commit

Permalink
Allow customising the extra modules that the container is built with.
Browse files Browse the repository at this point in the history
  • Loading branch information
SadieCat committed Nov 24, 2023
1 parent d71a5d2 commit 67dc814
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ FROM alpine:3.18
LABEL org.opencontainers.image.authors="Anope Team <[email protected]>"

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 && \
Expand All @@ -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 .. && \
Expand Down

0 comments on commit 67dc814

Please sign in to comment.