Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
## Readme

If you would like to change our readme, please __**do not**__ directly edit the readme, as it is auto-generated on each commit.
Instead edit the [readme-vars.yml](https://github.com/linuxserver/docker-wireguard/edit/master/readme-vars.yml).
Instead edit the [readme-vars.yml](https://github.com/linuxserver/docker-wireguard/edit/alpine/readme-vars.yml).

These variables are used in a template for our [Jenkins Builder](https://github.com/linuxserver/docker-jenkins-builder) as part of an ansible play.
Most of these variables are also carried over to [docs.linuxserver.io](https://docs.linuxserver.io/images/docker-wireguard)
Expand Down Expand Up @@ -115,7 +115,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64

## Update the changelog

If you are modifying the Dockerfiles or any of the startup scripts in [root](https://github.com/linuxserver/docker-wireguard/tree/master/root), add an entry to the changelog
If you are modifying the Dockerfiles or any of the startup scripts in [root](https://github.com/linuxserver/docker-wireguard/tree/alpine/root), add an entry to the changelog

```yml
changelogs:
Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

------------------------------

- [ ] I have read the [contributing](https://github.com/linuxserver/docker-wireguard/blob/master/.github/CONTRIBUTING.md) guideline and understand that I have made the correct modifications
- [ ] I have read the [contributing](https://github.com/linuxserver/docker-wireguard/blob/alpine/.github/CONTRIBUTING.md) guideline and understand that I have made the correct modifications

------------------------------

Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/external_trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,24 @@ on:
workflow_dispatch:

jobs:
external-trigger-master:
external-trigger-alpine:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.3

- name: External Trigger
if: github.ref == 'refs/heads/master'
if: github.ref == 'refs/heads/alpine'
run: |
if [ -n "${{ secrets.PAUSE_EXTERNAL_TRIGGER_WIREGUARD_MASTER }}" ]; then
echo "**** Github secret PAUSE_EXTERNAL_TRIGGER_WIREGUARD_MASTER is set; skipping trigger. ****"
if [ -n "${{ secrets.PAUSE_EXTERNAL_TRIGGER_WIREGUARD_ALPINE }}" ]; then
echo "**** Github secret PAUSE_EXTERNAL_TRIGGER_WIREGUARD_ALPINE is set; skipping trigger. ****"
exit 0
fi
echo "**** External trigger running off of master branch. To disable this trigger, set a Github secret named \"PAUSE_EXTERNAL_TRIGGER_WIREGUARD_MASTER\". ****"
echo "**** External trigger running off of alpine branch. To disable this trigger, set a Github secret named \"PAUSE_EXTERNAL_TRIGGER_WIREGUARD_ALPINE\". ****"
echo "**** Retrieving external version ****"
EXT_RELEASE=$(curl -u ${{ secrets.CR_USER }}:${{ secrets.CR_PAT }} -sX GET https://api.github.com/repos/WireGuard/wireguard-tools/tags | jq -r .[0].name)
if [ -z "${EXT_RELEASE}" ] || [ "${EXT_RELEASE}" == "null" ]; then
echo "**** Can't retrieve external version, exiting ****"
FAILURE_REASON="Can't retrieve external version for wireguard branch master"
FAILURE_REASON="Can't retrieve external version for wireguard branch alpine"
GHA_TRIGGER_URL="https://github.com/linuxserver/docker-wireguard/actions/runs/${{ github.run_id }}"
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 16711680,
"description": "**Trigger Failed** \n**Reason:** '"${FAILURE_REASON}"' \n**Trigger URL:** '"${GHA_TRIGGER_URL}"' \n"}],
Expand All @@ -32,7 +32,7 @@ jobs:
echo "**** External version: ${EXT_RELEASE} ****"
echo "**** Retrieving last pushed version ****"
image="linuxserver/wireguard"
tag="latest"
tag="alpine"
token=$(curl -sX GET \
"https://ghcr.io/token?scope=repository%3Alinuxserver%2Fwireguard%3Apull" \
| jq -r '.token')
Expand All @@ -54,7 +54,7 @@ jobs:
IMAGE_VERSION=$(echo ${IMAGE_RELEASE} | awk -F'-ls' '{print $1}')
if [ -z "${IMAGE_VERSION}" ]; then
echo "**** Can't retrieve last pushed version, exiting ****"
FAILURE_REASON="Can't retrieve last pushed version for wireguard tag latest"
FAILURE_REASON="Can't retrieve last pushed version for wireguard tag alpine"
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 16711680,
"description": "**Trigger Failed** \n**Reason:** '"${FAILURE_REASON}"' \n"}],
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}
Expand All @@ -64,13 +64,13 @@ jobs:
if [ "${EXT_RELEASE}" == "${IMAGE_VERSION}" ]; then
echo "**** Version ${EXT_RELEASE} already pushed, exiting ****"
exit 0
elif [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-wireguard/job/master/lastBuild/api/json | jq -r '.building') == "true" ]; then
elif [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-wireguard/job/alpine/lastBuild/api/json | jq -r '.building') == "true" ]; then
echo "**** New version ${EXT_RELEASE} found; but there already seems to be an active build on Jenkins; exiting ****"
exit 0
else
echo "**** New version ${EXT_RELEASE} found; old version was ${IMAGE_VERSION}. Triggering new build ****"
response=$(curl -iX POST \
https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-wireguard/job/master/buildWithParameters?PACKAGE_CHECK=false \
https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-wireguard/job/alpine/buildWithParameters?PACKAGE_CHECK=false \
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} | grep -i location | sed "s|^[L|l]ocation: \(.*\)|\1|")
echo "**** Jenkins job queue url: ${response%$'\r'} ****"
echo "**** Sleeping 10 seconds until job starts ****"
Expand All @@ -85,7 +85,7 @@ jobs:
--data-urlencode "description=GHA external trigger https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
--data-urlencode "Submit=Submit"
echo "**** Notifying Discord ****"
TRIGGER_REASON="A version change was detected for wireguard tag latest. Old version:${IMAGE_VERSION} New version:${EXT_RELEASE}"
TRIGGER_REASON="A version change was detected for wireguard tag alpine. Old version:${IMAGE_VERSION} New version:${EXT_RELEASE}"
curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 9802903,
"description": "**Build Triggered** \n**Reason:** '"${TRIGGER_REASON}"' \n**Build URL:** '"${buildurl}display/redirect"' \n"}],
"username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/greetings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ jobs:
steps:
- uses: actions/first-interaction@v1
with:
issue-message: 'Thanks for opening your first issue here! Be sure to follow the [bug](https://github.com/linuxserver/docker-wireguard/blob/master/.github/ISSUE_TEMPLATE/issue.bug.md) or [feature](https://github.com/linuxserver/docker-wireguard/blob/master/.github/ISSUE_TEMPLATE/issue.feature.md) issue templates!'
pr-message: 'Thanks for opening this pull request! Be sure to follow the [pull request template](https://github.com/linuxserver/docker-wireguard/blob/master/.github/PULL_REQUEST_TEMPLATE.md)!'
issue-message: 'Thanks for opening your first issue here! Be sure to follow the [bug](https://github.com/linuxserver/docker-wireguard/blob/alpine/.github/ISSUE_TEMPLATE/issue.bug.md) or [feature](https://github.com/linuxserver/docker-wireguard/blob/alpine/.github/ISSUE_TEMPLATE/issue.feature.md) issue templates!'
pr-message: 'Thanks for opening this pull request! Be sure to follow the [pull request template](https://github.com/linuxserver/docker-wireguard/blob/alpine/.github/PULL_REQUEST_TEMPLATE.md)!'
repo-token: ${{ secrets.GITHUB_TOKEN }}
14 changes: 7 additions & 7 deletions .github/workflows/package_trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,25 @@ on:
workflow_dispatch:

jobs:
package-trigger-master:
package-trigger-alpine:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.3

- name: Package Trigger
if: github.ref == 'refs/heads/master'
if: github.ref == 'refs/heads/alpine'
run: |
if [ -n "${{ secrets.PAUSE_PACKAGE_TRIGGER_WIREGUARD_MASTER }}" ]; then
echo "**** Github secret PAUSE_PACKAGE_TRIGGER_WIREGUARD_MASTER is set; skipping trigger. ****"
if [ -n "${{ secrets.PAUSE_PACKAGE_TRIGGER_WIREGUARD_ALPINE }}" ]; then
echo "**** Github secret PAUSE_PACKAGE_TRIGGER_WIREGUARD_ALPINE is set; skipping trigger. ****"
exit 0
fi
if [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-wireguard/job/master/lastBuild/api/json | jq -r '.building') == "true" ]; then
if [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-wireguard/job/alpine/lastBuild/api/json | jq -r '.building') == "true" ]; then
echo "**** There already seems to be an active build on Jenkins; skipping package trigger ****"
exit 0
fi
echo "**** Package trigger running off of master branch. To disable, set a Github secret named \"PAUSE_PACKAGE_TRIGGER_WIREGUARD_MASTER\". ****"
echo "**** Package trigger running off of alpine branch. To disable, set a Github secret named \"PAUSE_PACKAGE_TRIGGER_WIREGUARD_ALPINE\". ****"
response=$(curl -iX POST \
https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-wireguard/job/master/buildWithParameters?PACKAGE_CHECK=true \
https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-wireguard/job/alpine/buildWithParameters?PACKAGE_CHECK=true \
--user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} | grep -i location | sed "s|^[L|l]ocation: \(.*\)|\1|")
echo "**** Jenkins job queue url: ${response%$'\r'} ****"
echo "**** Sleeping 10 seconds until job starts ****"
Expand Down
92 changes: 40 additions & 52 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,63 +1,51 @@
FROM ghcr.io/linuxserver/baseimage-ubuntu:jammy
FROM ghcr.io/linuxserver/baseimage-alpine:3.16

# set version label
ARG BUILD_DATE
ARG VERSION
ARG WIREGUARD_RELEASE
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="aptalca"

ENV DEBIAN_FRONTEND="noninteractive"
LABEL maintainer="thespad"

RUN \
echo "**** install dependencies ****" && \
apt-get update && \
apt-get install -y --no-install-recommends \
bc \
build-essential \
curl \
dkms \
git \
gnupg \
ifupdown \
iproute2 \
iptables \
iputils-ping \
jq \
libc6 \
libelf-dev \
net-tools \
netcat \
openresolv \
perl \
pkg-config \
qrencode && \
echo "**** install wireguard-tools ****" && \
if [ -z ${WIREGUARD_RELEASE+x} ]; then \
WIREGUARD_RELEASE=$(curl -sX GET "https://api.github.com/repos/WireGuard/wireguard-tools/tags" \
| jq -r .[0].name); \
fi && \
cd /app && \
git clone https://git.zx2c4.com/wireguard-linux-compat && \
git clone https://git.zx2c4.com/wireguard-tools && \
cd wireguard-tools && \
git checkout "${WIREGUARD_RELEASE}" && \
make -C src -j$(nproc) && \
make -C src install && \
echo "**** install CoreDNS ****" && \
COREDNS_VERSION=$(curl -sX GET "https://api.github.com/repos/coredns/coredns/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]' | awk '{print substr($1,2); }') && \
curl -o \
/tmp/coredns.tar.gz -L \
"https://github.com/coredns/coredns/releases/download/v${COREDNS_VERSION}/coredns_${COREDNS_VERSION}_linux_amd64.tgz" && \
tar xf \
/tmp/coredns.tar.gz -C \
/app && \
echo "**** clean up ****" && \
rm -rf \
/tmp/* \
/var/lib/apt/lists/* \
/var/tmp/*
echo "**** install dependencies ****" && \
apk add --no-cache --virtual=build-dependencies \
bc \
build-base \
coredns \
elfutils-dev \
gcc \
git \
linux-headers && \
apk add --no-cache \
bc \
coredns \
gnupg \
iproute2 \
iptables \
iputils \
libqrencode \
net-tools \
openresolv \
perl && \
echo "wireguard" >> /etc/modules && \
echo "**** install wireguard-tools ****" && \
if [ -z ${WIREGUARD_RELEASE+x} ]; then \
WIREGUARD_RELEASE=$(curl -sX GET "https://api.github.com/repos/WireGuard/wireguard-tools/tags" \
| jq -r .[0].name); \
fi && \
cd /app && \
git clone https://git.zx2c4.com/wireguard-linux-compat && \
git clone https://git.zx2c4.com/wireguard-tools && \
cd wireguard-tools && \
git checkout "${WIREGUARD_RELEASE}" && \
make -C src -j$(nproc) && \
make -C src install && \
sed -i '/\[\[ $proto == -4 \]\] && cmd sysctl -q net\.ipv4\.conf\.all\.src_valid_mark=1/d' /usr/bin/wg-quick && \
echo "**** clean up ****" && \
apk del --no-network build-dependencies && \
rm -rf \
/tmp/*

# add local files
COPY /root /
Expand Down
92 changes: 40 additions & 52 deletions Dockerfile.aarch64
Original file line number Diff line number Diff line change
@@ -1,63 +1,51 @@
FROM ghcr.io/linuxserver/baseimage-ubuntu:arm64v8-jammy
FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.16

# set version label
ARG BUILD_DATE
ARG VERSION
ARG WIREGUARD_RELEASE
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="aptalca"

ENV DEBIAN_FRONTEND="noninteractive"
LABEL maintainer="thespad"

RUN \
echo "**** install dependencies ****" && \
apt-get update && \
apt-get install -y --no-install-recommends \
bc \
build-essential \
curl \
dkms \
git \
gnupg \
ifupdown \
iproute2 \
iptables \
iputils-ping \
jq \
libc6 \
libelf-dev \
net-tools \
netcat \
openresolv \
perl \
pkg-config \
qrencode && \
echo "**** install wireguard-tools ****" && \
if [ -z ${WIREGUARD_RELEASE+x} ]; then \
WIREGUARD_RELEASE=$(curl -sX GET "https://api.github.com/repos/WireGuard/wireguard-tools/tags" \
| jq -r .[0].name); \
fi && \
cd /app && \
git clone https://git.zx2c4.com/wireguard-linux-compat && \
git clone https://git.zx2c4.com/wireguard-tools && \
cd wireguard-tools && \
git checkout "${WIREGUARD_RELEASE}" && \
make -C src -j$(nproc) && \
make -C src install && \
echo "**** install CoreDNS ****" && \
COREDNS_VERSION=$(curl -sX GET "https://api.github.com/repos/coredns/coredns/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]' | awk '{print substr($1,2); }') && \
curl -o \
/tmp/coredns.tar.gz -L \
"https://github.com/coredns/coredns/releases/download/v${COREDNS_VERSION}/coredns_${COREDNS_VERSION}_linux_arm64.tgz" && \
tar xf \
/tmp/coredns.tar.gz -C \
/app && \
echo "**** clean up ****" && \
rm -rf \
/tmp/* \
/var/lib/apt/lists/* \
/var/tmp/*
echo "**** install dependencies ****" && \
apk add --no-cache --virtual=build-dependencies \
bc \
build-base \
coredns \
elfutils-dev \
gcc \
git \
linux-headers && \
apk add --no-cache \
bc \
coredns \
gnupg \
iproute2 \
iptables \
iputils \
libqrencode \
net-tools \
openresolv \
perl && \
echo "wireguard" >> /etc/modules && \
echo "**** install wireguard-tools ****" && \
if [ -z ${WIREGUARD_RELEASE+x} ]; then \
WIREGUARD_RELEASE=$(curl -sX GET "https://api.github.com/repos/WireGuard/wireguard-tools/tags" \
| jq -r .[0].name); \
fi && \
cd /app && \
git clone https://git.zx2c4.com/wireguard-linux-compat && \
git clone https://git.zx2c4.com/wireguard-tools && \
cd wireguard-tools && \
git checkout "${WIREGUARD_RELEASE}" && \
make -C src -j$(nproc) && \
make -C src install && \
sed -i '/\[\[ $proto == -4 \]\] && cmd sysctl -q net\.ipv4\.conf\.all\.src_valid_mark=1/d' /usr/bin/wg-quick && \
echo "**** clean up ****" && \
apk del --no-network build-dependencies && \
rm -rf \
/tmp/*

# add local files
COPY /root /
Expand Down
Loading