summaryrefslogtreecommitdiff
path: root/docker
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2023-07-20 23:16:38 +0300
committerDonatas Abraitis <donatas@opensourcerouting.org>2023-07-20 23:57:34 +0300
commit845632283544f7f3c1fe4123146c00aaac3ad1cf (patch)
tree678eece3e858e3f02f8ec0a9c5e3e658dda40a73 /docker
parent27083f7885637143ca3a914b3c1391caec5ec231 (diff)
docker: Use libyang 2.1.80 for Alpine builds
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
Diffstat (limited to 'docker')
-rw-r--r--docker/alpine/Dockerfile19
1 files changed, 16 insertions, 3 deletions
diff --git a/docker/alpine/Dockerfile b/docker/alpine/Dockerfile
index b8c79682b1..d1c3060069 100644
--- a/docker/alpine/Dockerfile
+++ b/docker/alpine/Dockerfile
@@ -12,18 +12,29 @@ RUN apk add \
&& echo 'builder ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
RUN adduser -D -G abuild builder && su builder -c 'abuild-keygen -a -n'
+# This stage builds an APK for libyang
+FROM alpine-builder as alpine-apk-builder-libyang
+RUN mkdir -p /src/libyang
+COPY docker/alpine/libyang/APKBUILD /src/libyang
+RUN chown -R builder /pkgs /src
+USER builder
+RUN cd /src/libyang \
+ && abuild checksum \
+ && git init \
+ && abuild -r -P /pkgs/apk
+
# This stage builds a dist tarball from the source
FROM alpine:3.18 as source-builder
-
-RUN mkdir -p /src/alpine
+RUN mkdir -p /src/alpine /pkgs/apk
COPY alpine/APKBUILD.in /src/alpine
+COPY --from=alpine-apk-builder-libyang /pkgs/apk/src /pkgs/apk
+RUN cd /pkgs/apk/x86_64 && apk add --allow-untrusted *.apk
RUN source /src/alpine/APKBUILD.in \
&& apk add \
--no-cache \
--update-cache \
$makedepends \
&& pip install pytest
-RUN mkdir -p /pkgs/apk
COPY . /src
ARG PKGVER
RUN cd /src \
@@ -36,6 +47,8 @@ RUN cd /src \
# This stage builds an APK from the dist tarball
FROM alpine-builder as alpine-apk-builder
COPY --from=source-builder /src/frr-*.tar.gz /src/alpine/* /dist/
+COPY --from=alpine-apk-builder-libyang /pkgs/apk/src /pkgs/apk
+RUN cd /pkgs/apk/x86_64 && apk add --allow-untrusted *.apk
RUN find /pkgs/apk -type f -name APKINDEX.tar.gz -delete
RUN chown -R builder /dist /pkgs
USER builder