-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathDockerfile
23 lines (18 loc) · 952 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
FROM alpine AS builder
RUN apk add git ca-certificates > /dev/null 2>/dev/null
RUN git clone https://github.com/pivpn/pivpn.git /clone
FROM debian:stable-slim
RUN adduser --home /home/pivpn --disabled-password pivpn \
&& apt-get update && apt-get install -y -f --no-install-recommends wireguard-tools qrencode gnupg \
openvpn grepcidr expect curl nano sudo bsdmainutils bash-completion cron ca-certificates iproute2 \
net-tools iptables-persistent apt-transport-https whiptail dnsutils grep dhcpcd5 iptables-persistent
WORKDIR /home/pivpn
COPY sh/ /usr/local/bin/
COPY crontab /etc/cron.d/update
COPY --from=builder /clone /usr/local/src/pivpn
COPY run .
RUN chmod 0644 /etc/cron.d/update && crontab /etc/cron.d/update \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /var/tmp/* /etc/pivpn/openvpn/* /etc/openvpn/* /etc/wireguard/* /tmp/* || true \
&& chmod +x /home/pivpn/run /usr/local/bin/*
ENTRYPOINT ["./run"]