FROM alpine:3.5 AS builder RUN apk add --no-cache build-base git automake autoconf openssl-dev icu-dev RUN git clone --single-branch --depth=1 --recursive https://github.com/znc/znc.git /tmp/znc RUN mkdir -p /app /data RUN cd /tmp/znc \ && ./autogen.sh \ && ./configure --prefix="/app/znc" \ && make \ && make install ADD privmsg.cpp /tmp/ RUN cd /tmp/ \ && /app/znc/bin/znc-buildmod /tmp/privmsg.cpp \ && mv privmsg.so /app/znc/lib/znc/ FROM server_runit RUN apk add --no-cache sudo libcap openssl icu COPY --from=builder /app /app # -S: system, -h: home RUN adduser -S -h /data znc && chmod a+x /data