Merge pull request #213 from exepirit/master

build: reduce Docker image size
This commit is contained in:
Revertron
2022-01-30 14:12:32 +01:00
committed by GitHub
2 changed files with 25 additions and 2 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
FROM ubuntu
FROM debian:stretch-slim
LABEL Description="Alfis Alternative Free Identity System"
LABEL URL="https://github.com/Revertron/Alfis/releases "
LABEL URL="https://github.com/Revertron/Alfis/releases"
ARG arch=amd64
ARG srv_port=4244
+23
View File
@@ -0,0 +1,23 @@
FROM alpine:3.15
LABEL Description="Alfis Alternative Free Identity System"
LABEL URL="https://github.com/Revertron/Alfis/releases"
ARG arch=amd64
ARG srv_port=4244
ARG dns_port=53
RUN apk add --no-cache curl && \
curl -SsL "https://github.com/Revertron/Alfis/releases/download/$(curl --silent "https://api.github.com/repos/Revertron/Alfis/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')/alfis-linux-${arch}-$(curl --silent "https://api.github.com/repos/Revertron/Alfis/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')-nogui" -o /usr/bin/alfis && \
chmod a+x /usr/bin/alfis && \
apk del curl
RUN /usr/bin/alfis -g > /etc/alfis.conf
EXPOSE ${srv_port}
EXPOSE ${dns_port}
EXPOSE ${dns_port}/udp
WORKDIR /var/lib/alfis
CMD ["/usr/bin/alfis", "-n", "-c", "/etc/alfis.conf"]