diff --git a/extmodules/Dockerfile b/extmodules/Dockerfile new file mode 100644 index 0000000..0a3ea31 --- /dev/null +++ b/extmodules/Dockerfile @@ -0,0 +1,12 @@ +FROM znc:stdonly + +RUN set -x \ + && apk add --no-cache \ + build-base \ + icu-dev \ + openssl-dev \ + perl \ + python3 +COPY znc-entrypoint.sh / + +ENTRYPOINT ["/znc-entrypoint.sh"] diff --git a/extmodules/znc-entrypoint.sh b/extmodules/znc-entrypoint.sh new file mode 100755 index 0000000..e690852 --- /dev/null +++ b/extmodules/znc-entrypoint.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +# Options. +DATADIR="/znc-data" + +# Build modules from source. +if [ -d "${DATADIR}/modules" ]; then + pushd "${DATADIR}/modules" > /dev/null || exit 1 + + # Find module sources. + modules=$(find "${DATADIR}/modules" -name "*.cpp") + + if [ -n "$modules" ]; then + # Build modules. + echo "Building modules $modules..." + /opt/znc/bin/znc-buildmod $modules + fi + + popd > /dev/null +fi + +exec /opt/znc/bin/znc -f -d /znc-data $@ diff --git a/Dockerfile b/stdonly/Dockerfile similarity index 88% rename from Dockerfile rename to stdonly/Dockerfile index 6b7e4f6..e8c16c1 100644 --- a/Dockerfile +++ b/stdonly/Dockerfile @@ -2,6 +2,9 @@ FROM alpine:3.5 ENV ZNC_VERSION 1.6.4 +# modperl and modpython are built, but won't be loadable. +# :extmodules image installs perl and python3 again, making these modules loadable. + ARG CONFIGUREFLAGS="--prefix=/opt/znc --enable-cyrus --enable-perl --enable-python" ARG CLEANCMD="apk del build-dependencies && rm -Rf /znc-src" ARG MAKEFLAGS="" @@ -12,9 +15,8 @@ RUN set -x \ && apk add --no-cache --virtual runtime-dependencies \ icu \ openssl \ - python3 \ - perl \ cyrus-sasl \ + ca-certificates \ && apk add --no-cache --virtual build-dependencies \ build-base \ icu-dev \