-
-
Notifications
You must be signed in to change notification settings - Fork 24
/
Dockerfile
33 lines (26 loc) · 826 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
24
25
26
27
28
29
30
31
32
33
FROM ubuntu:20.04
LABEL maintainer="psyhomb"
ARG USER
ARG UID
ENV USER=${USER:-wgcg} \
UID=${UID:-1000}
WORKDIR /data/wgcg
COPY . ./
RUN case ${UID} in \
0) HOME="/root" ;; \
*) HOME="/home/${USER}"; useradd -ou ${UID} ${USER} ;; \
esac \
&& mkdir -p ${HOME}/.gnupg ${HOME}/wireguard/wgcg \
&& chmod 700 ${HOME}/.gnupg \
&& mv wgcg.conf ${HOME}/wireguard/wgcg/ \
&& mv wgcg.sh /usr/local/bin/ \
&& chmod 644 ${HOME}/wireguard/wgcg/wgcg.conf \
&& chmod 755 /usr/local/bin/wgcg.sh \
&& chown -R ${USER}:${USER} ${HOME} \
&& apt-get update \
&& apt-get -y install --no-install-recommends wireguard-tools openssh-client gpg gpg-agent qrencode grepcidr \
&& apt-get -y --purge autoremove \
&& apt-get clean \
&& rm -vrf /var/lib/apt/lists/*
USER ${USER}
ENTRYPOINT ["/usr/local/bin/wgcg.sh"]