2023-01-29 00:43:17 +00:00
|
|
|
# syntax=docker/dockerfile:1
|
|
|
|
|
2023-06-26 17:57:56 +00:00
|
|
|
FROM ghcr.io/linuxserver/baseimage-alpine:3.17
|
2020-03-31 03:59:44 +00:00
|
|
|
|
|
|
|
# set version label
|
|
|
|
ARG BUILD_DATE
|
|
|
|
ARG VERSION
|
|
|
|
ARG WIREGUARD_RELEASE
|
|
|
|
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
|
2023-04-26 08:50:27 +00:00
|
|
|
LABEL maintainer="thespad"
|
2020-03-31 03:59:44 +00:00
|
|
|
|
|
|
|
RUN \
|
2022-10-09 19:37:09 +00:00
|
|
|
echo "**** install dependencies ****" && \
|
2023-04-26 08:50:27 +00:00
|
|
|
apk add --no-cache --virtual=build-dependencies \
|
|
|
|
build-base \
|
|
|
|
elfutils-dev \
|
|
|
|
gcc \
|
2022-10-09 19:37:09 +00:00
|
|
|
git \
|
2023-04-26 08:50:27 +00:00
|
|
|
linux-headers && \
|
|
|
|
apk add --no-cache \
|
|
|
|
bc \
|
|
|
|
coredns \
|
2023-01-29 00:01:43 +00:00
|
|
|
gnupg \
|
2023-04-26 08:50:27 +00:00
|
|
|
grep \
|
2022-10-09 19:37:09 +00:00
|
|
|
iproute2 \
|
|
|
|
iptables \
|
2023-04-26 08:50:27 +00:00
|
|
|
ip6tables \
|
|
|
|
iputils \
|
|
|
|
libcap-utils \
|
|
|
|
libqrencode \
|
2022-10-09 19:37:09 +00:00
|
|
|
net-tools \
|
|
|
|
openresolv \
|
2023-04-26 08:50:27 +00:00
|
|
|
perl && \
|
|
|
|
echo "wireguard" >> /etc/modules && \
|
2022-10-09 19:37:09 +00:00
|
|
|
echo "**** install wireguard-tools ****" && \
|
|
|
|
if [ -z ${WIREGUARD_RELEASE+x} ]; then \
|
|
|
|
WIREGUARD_RELEASE=$(curl -sX GET "https://api.github.com/repos/WireGuard/wireguard-tools/tags" \
|
2023-04-26 08:50:27 +00:00
|
|
|
| jq -r .[0].name); \
|
2022-10-09 19:37:09 +00:00
|
|
|
fi && \
|
|
|
|
cd /app && \
|
|
|
|
git clone https://git.zx2c4.com/wireguard-tools && \
|
|
|
|
cd wireguard-tools && \
|
|
|
|
git checkout "${WIREGUARD_RELEASE}" && \
|
2023-01-29 00:01:43 +00:00
|
|
|
sed -i 's|\[\[ $proto == -4 \]\] && cmd sysctl -q net\.ipv4\.conf\.all\.src_valid_mark=1|[[ $proto == -4 ]] \&\& [[ $(sysctl -n net.ipv4.conf.all.src_valid_mark) != 1 ]] \&\& cmd sysctl -q net.ipv4.conf.all.src_valid_mark=1|' src/wg-quick/linux.bash && \
|
2022-10-09 19:37:09 +00:00
|
|
|
make -C src -j$(nproc) && \
|
|
|
|
make -C src install && \
|
|
|
|
echo "**** clean up ****" && \
|
2023-04-26 08:50:27 +00:00
|
|
|
apk del --no-network build-dependencies && \
|
2022-10-09 19:37:09 +00:00
|
|
|
rm -rf \
|
2023-04-26 08:50:27 +00:00
|
|
|
/tmp/*
|
2020-03-31 03:59:44 +00:00
|
|
|
|
|
|
|
# add local files
|
|
|
|
COPY /root /
|
|
|
|
|
|
|
|
# ports and volumes
|
|
|
|
EXPOSE 51820/udp
|