tools/alpine: Build our own wireguard-tools package

Currently, there is a conflict in musl versions between stable
(used for tools/alpine) and edge (where wireguard-tools is).
This cased the tools/alpine build to fail.

With this commit we build our own wireguard-tools package,
using the  APKBUILD file from edge, against the libraries
libraries from stable. We then add the wireguard-tools package
to the mirror.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
This commit is contained in:
Rolf Neugebauer 2018-02-28 14:39:47 +00:00
parent 018f3602c0
commit e0e490d4c6

View File

@ -12,8 +12,18 @@ RUN cat /tmp/packages.$(uname -m) >> /tmp/packages && \
mkdir -p /mirror/$(uname -m) && \
apk fetch --recursive -o /mirror/$(uname -m) $(apk info; cat /tmp/packages)
# add the tools for WireGuard, since the kernel module is now included, but from edge/testing
RUN apk fetch --recursive -o /mirror/$(uname -m) -X http://dl-cdn.alpinelinux.org/alpine/edge/testing -U wireguard-tools
# It's tricky to mix edge/testing packages which sometimes leads to dependency conflicts.
# wireguard-tools currently is only in edge, so here we build our own package using the
# APKBUILD file from edge.
RUN apk add alpine-sdk libmnl-dev curl && \
adduser -D builder && \
addgroup builder abuild && \
mkdir -p /wireguard && \
chmod 0777 /wireguard && \
cd /wireguard && \
curl -fsSLo APKBUILD https://git.alpinelinux.org/cgit/aports/plain/testing/wireguard-tools/APKBUILD && \
su -c "abuild-keygen -a -n && abuild -r" builder && \
cp /home/builder/packages/$(uname -m)/wireguard-tools-[0-9]*.apk /mirror/$(uname -m)
# install abuild for signing
RUN apk add --no-cache abuild