diff --git a/znc/Dockerfile b/znc/Dockerfile index 2c83626..bbbf549 100644 --- a/znc/Dockerfile +++ b/znc/Dockerfile @@ -6,44 +6,51 @@ # -v /volumes/znc:/home/user/.znc \ # jess/znc # -FROM debian:stretch +FROM alpine:latest MAINTAINER Jessie Frazelle -RUN apt-get update && apt-get install -y \ +RUN apk add --no-cache \ ca-certificates \ - curl \ - libdatetime-perl \ - libglib2.0-0 \ - libwww-perl \ + glib \ perl \ - && rm -rf /var/lib/apt/lists/* + perl-datetime \ + perl-libwww ENV HOME /home/user -RUN useradd --create-home --home-dir $HOME user \ +RUN adduser -u 1001 -D user \ && chown -R user:user $HOME ENV LANG C.UTF-8 ENV ZNC_VERSION 1.6.4 -RUN buildDeps=' \ - build-essential \ - libssl-dev \ - libperl-dev \ - ' \ - && set -x \ - && apt-get update && apt-get install -y $buildDeps --no-install-recommends \ - && rm -rf /var/lib/apt/lists/* \ +RUN set -x \ + && apk add --no-cache --virtual .build-deps \ + build-base \ + curl \ + libressl-dev \ + perl-dev \ + tar \ && curl -sSL "http://znc.in/releases/znc-${ZNC_VERSION}.tar.gz" -o /tmp/znc.tar.gz \ && mkdir -p /usr/src/znc \ && tar -xzf /tmp/znc.tar.gz -C /usr/src/znc --strip-components 1 \ && rm /tmp/znc.tar.gz* \ - && cd /usr/src/znc \ - && ./configure \ - && make -j8 \ - && make install \ + && ( \ + cd /usr/src/znc \ + && ./configure \ + && make -j8 \ + && make install \ + ) \ && rm -rf /usr/src/znc \ - && apt-get purge -y --auto-remove $buildDeps + && runDeps="$( \ + scanelf --needed --nobanner --recursive /usr \ + | awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \ + | sort -u \ + | xargs -r apk info --installed \ + | sort -u \ + )" \ + && apk add --no-cache --virtual .irssi-rundeps $runDeps \ + && apk del .build-deps WORKDIR $HOME USER user