From 1ec9a5b5755161bb4b9c910a56129ba6ce2deb0e Mon Sep 17 00:00:00 2001 From: Matthew Cengia Date: Mon, 8 Apr 2024 13:56:01 +1000 Subject: [PATCH] Update to podman 5, including netavark and pasta --- Dockerfile | 43 +++++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/Dockerfile b/Dockerfile index 68fdc33..43069c0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,7 +27,7 @@ RUN apk add --update --no-cache git make gcc pkgconf musl-dev \ # podman (without systemd support) FROM podmanbuildbase AS podman RUN apk add --update --no-cache tzdata curl -ARG PODMAN_VERSION=v4.9.4 +ARG PODMAN_VERSION=v5.0.0 ARG PODMAN_BUILDTAGS='seccomp selinux apparmor exclude_graphdriver_devicemapper containers_image_openpgp' ARG PODMAN_CGO=1 RUN git clone -c 'advice.detachedHead=false' --depth=1 --branch ${PODMAN_VERSION} https://github.com/containers/podman src/github.com/containers/podman @@ -68,29 +68,27 @@ RUN set -ex; \ ! ldd $PLUGINBIN; \ done +# netavark -# slirp4netns -FROM podmanbuildbase AS slirp4netns +FROM podmanbuildbase AS netavark WORKDIR / -RUN apk add --update --no-cache autoconf automake meson ninja linux-headers libcap-static libcap-dev clang llvm -# Build libslirp -ARG LIBSLIRP_VERSION=v4.7.0 -RUN git clone -c 'advice.detachedHead=false' --depth=1 --branch=${LIBSLIRP_VERSION} https://gitlab.freedesktop.org/slirp/libslirp.git -WORKDIR /libslirp -RUN set -ex; \ - rm -rf /usr/lib/libglib-2.0.so /usr/lib/libintl.so; \ - ln -s /usr/bin/clang /go/bin/clang; \ - LDFLAGS="-s -w -static" meson --prefix /usr -D default_library=static build; \ - ninja -C build install -# Build slirp4netns +RUN apk add --update --no-cache cargo +# Build passt +ARG NETAVARK_VERSION=v1.10.3 +RUN git clone -c 'advice.detachedHead=false' --depth=1 --branch=${NETAVARK_VERSION} https://github.com/containers/netavark +WORKDIR /netavark +RUN LDFLAGS=-static make + + +# passt +FROM podmanbuildbase AS passt WORKDIR / -ARG SLIRP4NETNS_VERSION=v1.2.3 -RUN git clone -c 'advice.detachedHead=false' --depth=1 --branch $SLIRP4NETNS_VERSION https://github.com/rootless-containers/slirp4netns.git -WORKDIR /slirp4netns -RUN set -ex; \ - ./autogen.sh; \ - LDFLAGS=-static ./configure --prefix=/usr; \ - make +RUN apk add --update --no-cache autoconf automake meson ninja linux-headers libcap-static libcap-dev clang llvm coreutils +# Build passt +ARG PASST_VERSION=2024_04_05.954589b +RUN git clone -c 'advice.detachedHead=false' --depth=1 --branch=${PASST_VERSION} git://passt.top/passt +WORKDIR /passt +RUN make static # fuse-overlayfs (derived from https://github.com/containers/fuse-overlayfs/blob/master/Dockerfile.static) @@ -184,7 +182,8 @@ COPY conf/crun-containers.conf /etc/containers/containers.conf # Build podman image with rootless binaries and CNI plugins FROM rootlesspodmanrunc AS podmanall RUN apk add --no-cache iptables ip6tables -COPY --from=slirp4netns /slirp4netns/slirp4netns /usr/local/bin/slirp4netns +COPY --from=passt /passt/pasta /usr/local/bin/pasta +COPY --from=netavark /netavark/bin/netavark /usr/local/lib/podman/netavark COPY --from=cniplugins /usr/local/lib/cni /usr/local/lib/cni COPY --from=catatonit /catatonit/catatonit /usr/local/lib/podman/catatonit COPY conf/cni /etc/cni