diff --git a/Dockerfile b/Dockerfile index 4f9c502..67c1c41 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,16 +22,13 @@ RUN apk add --update --no-cache git make gcc pkgconf musl-dev \ glib-static libc-dev gpgme-dev protobuf-dev protobuf-c-dev \ libseccomp-dev libseccomp-static libselinux-dev ostree-dev openssl iptables \ bash go-md2man -# Hotfix for musl build failure https://github.com/mattn/go-sqlite3/issues/1164 -# And https://github.com/mattn/go-sqlite3/issues/958 -#RUN go get github.com/mattn/go-sqlite3@v1.14.22 # podman (without systemd support) FROM podmanbuildbase AS podman RUN apk add --update --no-cache tzdata curl -ARG PODMAN_VERSION=v4.9.3 +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 @@ -39,15 +36,11 @@ RUN git clone -c 'advice.detachedHead=false' --depth=1 --branch=${PODMAN_VERSION WORKDIR $GOPATH/src/github.com/containers/podman RUN set -ex; \ export CGO_ENABLED=$PODMAN_CGO; \ - # Workaround for build failure https://github.com/mattn/go-sqlite3/issues/1164 (fixed in future go-sqlite3 release - #export CGO_CFLAGS="-D_LARGEFILE64_SOURCE"; \ - #go get github.com/mattn/go-sqlite3@v1.14.22 ; \ make bin/podman LDFLAGS_PODMAN="-s -w -extldflags '-static'" BUILDTAGS='${PODMAN_BUILDTAGS}'; \ mv bin/podman /usr/local/bin/podman; \ podman --help >/dev/null; \ ! ldd /usr/local/bin/podman RUN set -ex; \ - #go get github.com/mattn/go-sqlite3@v1.14.22 ; \ CGO_ENABLED=0 make bin/rootlessport BUILDFLAGS=" -mod=vendor -ldflags=\"-s -w -extldflags '-static'\""; \ mkdir -p /usr/local/lib/podman; \ mv bin/rootlessport /usr/local/lib/podman/rootlessport; \ @@ -68,31 +61,32 @@ RUN set -ex; \ # CNI network backend and Cgroups V1 are deprecated +# https://github.com/containers/podman/blob/main/docs/source/markdown/podman-network.1.md # CNI plugins (removed in podman 5.0 and replaced by netavark) -FROM podmanbuildbase AS cniplugins -ARG CNI_PLUGIN_VERSION=v1.4.0 -ARG CNI_PLUGINS="ipam/host-local main/loopback main/bridge meta/portmap meta/tuning meta/firewall" -RUN git clone -c 'advice.detachedHead=false' --depth=1 --branch=${CNI_PLUGIN_VERSION} https://github.com/containernetworking/plugins /go/src/github.com/containernetworking/plugins -WORKDIR /go/src/github.com/containernetworking/plugins -RUN set -ex; \ - for PLUGINDIR in $CNI_PLUGINS; do \ - PLUGINBIN=/usr/local/lib/cni/$(basename $PLUGINDIR); \ - CGO_ENABLED=0 go build -o $PLUGINBIN -ldflags "-s -w -extldflags '-static'" ./plugins/$PLUGINDIR; \ - ! ldd $PLUGINBIN; \ - done +#FROM podmanbuildbase AS cniplugins +#ARG CNI_PLUGIN_VERSION=v1.4.0 +#ARG CNI_PLUGINS="ipam/host-local main/loopback main/bridge meta/portmap meta/tuning meta/firewall" +#RUN git clone -c 'advice.detachedHead=false' --depth=1 --branch=${CNI_PLUGIN_VERSION} https://github.com/containernetworking/plugins /go/src/github.com/containernetworking/plugins +#WORKDIR /go/src/github.com/containernetworking/plugins +#RUN set -ex; \ +# for PLUGINDIR in $CNI_PLUGINS; do \ +# PLUGINBIN=/usr/local/lib/cni/$(basename $PLUGINDIR); \ +# CGO_ENABLED=0 go build -o $PLUGINBIN -ldflags "-s -w -extldflags '-static'" ./plugins/$PLUGINDIR; \ +# ! ldd $PLUGINBIN; \ +# done # netavark -#FROM podmanbuildbase AS netavark -##RUN apk add --update --no-cache tzdata curl rust cargo -#RUN apk add --update --no-cache rust cargo -#ARG NETAVARK_VERSION=v1.9.0 -#RUN git clone -c 'advice.detachedHead=false' --depth=1 --branch=${NETAVARK_VERSION} https://github.com/containers/netavark /netavark -##RUN git clone -c 'advice.detachedHead=false' --depth=1 --branch=${NETAVARK_VERSION:-$(curl -s https://api.github.com/repos/containers/netavark/releases/latest | grep tag_name | cut -d '"' -f 4)} https://github.com/containers/netavark /netavark -#WORKDIR /netavark -#RUN set -ex; \ -# make build_netavark -## make +FROM podmanbuildbase AS netavark +#RUN apk add --update --no-cache tzdata curl rust cargo +RUN apk add --update --no-cache rust cargo +ARG NETAVARK_VERSION=v1.10.3 +RUN git clone -c 'advice.detachedHead=false' --depth=1 --branch=${NETAVARK_VERSION} https://github.com/containers/netavark /netavark +#RUN git clone -c 'advice.detachedHead=false' --depth=1 --branch=${NETAVARK_VERSION:-$(curl -s https://api.github.com/repos/containers/netavark/releases/latest | grep tag_name | cut -d '"' -f 4)} https://github.com/containers/netavark /netavark +WORKDIR /netavark +RUN set -ex; \ + make build_netavark +# make # slirp4netns @@ -110,7 +104,7 @@ RUN set -ex; \ ninja -C build install # Build slirp4netns WORKDIR / -ARG SLIRP4NETNS_VERSION=v1.2.2 +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 #RUN git clone -c 'advice.detachedHead=false' --depth=1 --branch=${SLIRP4NETNS_VERSION:-$(curl -s https://api.github.com/repos/rootless-containers/slirp4netns/releases/latest | grep tag_name | cut -d '"' -f 4)} https://github.com/rootless-containers/slirp4netns.git WORKDIR /slirp4netns @@ -192,9 +186,10 @@ FROM rootlesspodmanbase AS rootlesspodmanrunc COPY --from=runc /usr/local/bin/runc /usr/local/bin/runc # Download crun -# (switched keyserver from sks to ubuntu since sks is offline now and gpg refuses to import keys from keys.openpgp.org because it does not provide a user ID with the key.) +# (switched keyserver from sks to ubuntu since sks is offline now +# and gpg refuses to import keys from keys.openpgp.org because it does not provide a user ID with the key.) FROM gpg AS crun -ARG CRUN_VERSION=1.14 +ARG CRUN_VERSION=1.14.4 RUN set -ex; \ wget -O /usr/local/bin/crun https://github.com/containers/crun/releases/download/$CRUN_VERSION/crun-${CRUN_VERSION}-linux-amd64-disable-systemd; \ wget -O /tmp/crun.asc https://github.com/containers/crun/releases/download/$CRUN_VERSION/crun-${CRUN_VERSION}-linux-amd64-disable-systemd.asc; \ @@ -212,7 +207,7 @@ COPY conf/crun-containers.conf /etc/containers/containers.conf FROM rootlesspodmanrunc AS podmanall RUN apk add --no-cache iptables ip6tables COPY --from=slirp4netns /slirp4netns/slirp4netns /usr/local/bin/slirp4netns -COPY --from=cniplugins /usr/local/lib/cni /usr/local/lib/cni -#COPY --from=netavark /netavark/bin/netavark /usr/local/bin/netavark +#COPY --from=cniplugins /usr/local/lib/cni /usr/local/lib/cni +COPY --from=netavark /netavark/bin/netavark /usr/local/bin/netavark COPY --from=catatonit /catatonit/catatonit /usr/local/lib/podman/catatonit -COPY conf/cni /etc/cni +#COPY conf/cni /etc/cni diff --git a/Dockerfile-remote b/Dockerfile-remote index 0881515..7782bb4 100644 --- a/Dockerfile-remote +++ b/Dockerfile-remote @@ -9,7 +9,7 @@ RUN apk add --update --no-cache git make gcc pkgconf musl-dev \ # podman remote FROM podmanbuildbase AS podman-remote RUN apk add --update --no-cache curl -ARG PODMAN_VERSION=v4.9.3 +ARG PODMAN_VERSION=v5.0.0 RUN git clone -c advice.detachedHead=false --depth=1 --branch=${PODMAN_VERSION} https://github.com/containers/podman src/github.com/containers/podman WORKDIR $GOPATH/src/github.com/containers/podman RUN make install.tools