Skip to content

Commit

Permalink
Update Dockerfile to use released versions of Go, Rust, Alpine as wel…
Browse files Browse the repository at this point in the history
…l as various dependencies
  • Loading branch information
trentapple committed Aug 16, 2024
1 parent f6e6d72 commit b44959b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
25 changes: 13 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Download gpg
FROM alpine:3.19 AS gpg
FROM alpine:3.20 AS gpg
RUN apk add --no-cache gnupg


# runc
FROM golang:1.22-alpine3.19 AS runc
FROM golang:1.22-alpine3.20 AS runc
ARG RUNC_VERSION=v1.1.13
# Download runc binary release since static build doesn't work with musl libc anymore since 1.1.8, see https://github.com/opencontainers/runc/issues/3950
RUN set -eux; \
Expand All @@ -16,7 +16,7 @@ RUN set -eux; \


# podman build base
FROM golang:1.21-alpine3.19 AS podmanbuildbase
FROM golang:1.22-alpine3.20 AS podmanbuildbase
RUN apk add --update --no-cache git make gcc pkgconf musl-dev \
btrfs-progs btrfs-progs-dev libassuan-dev lvm2-dev device-mapper \
glib-static libc-dev gpgme-dev protobuf-dev protobuf-c-dev \
Expand All @@ -28,7 +28,7 @@ RUN apk add --update --no-cache git make gcc pkgconf musl-dev \
FROM podmanbuildbase AS podman
RUN apk add --update --no-cache tzdata curl

ARG PODMAN_VERSION=v5.2.0
ARG PODMAN_VERSION=v5.2.1
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
Expand All @@ -52,13 +52,13 @@ RUN set -ex; \


# rust
FROM rust:1.78-alpine3.19 AS rustbase
FROM rust:1.80-alpine3.20 AS rustbase
RUN apk add --update --no-cache git make musl-dev


# aardvark-dns
FROM rustbase AS aardvark-dns
ARG AARDVARKDNS_VERSION=v1.11.0
ARG AARDVARKDNS_VERSION=v1.12.1
RUN git clone -c 'advice.detachedHead=false' --depth=1 --branch=$AARDVARKDNS_VERSION https://github.com/containers/aardvark-dns
WORKDIR /aardvark-dns
ENV RUSTFLAGS='-C link-arg=-s'
Expand All @@ -70,7 +70,7 @@ FROM podmanbuildbase AS passt
WORKDIR /
RUN apk add --update --no-cache autoconf automake meson ninja linux-headers libcap-static libcap-dev clang llvm coreutils
# https://passt.top/passt/
ARG PASST_VERSION=2024_08_06.ee36266
ARG PASST_VERSION=2024_08_14.61c0b0d
RUN git clone -c 'advice.detachedHead=false' --depth=1 --branch=$PASST_VERSION git://passt.top/passt
WORKDIR /passt
RUN set -ex; \
Expand Down Expand Up @@ -99,7 +99,7 @@ RUN set -ex; \
## build using rustbase
FROM rustbase AS netavark
RUN apk add --update --no-cache protoc
ARG NETAVARK_VERSION=v1.11.0
ARG NETAVARK_VERSION=v1.12.1
RUN git clone -c 'advice.detachedHead=false' --depth=1 --branch=$NETAVARK_VERSION https://github.com/containers/netavark
WORKDIR /netavark
ENV RUSTFLAGS='-C link-arg=-s'
Expand Down Expand Up @@ -188,7 +188,7 @@ RUN set -ex; \
# (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.16
ARG CRUN_VERSION=1.16.1
RUN set -ex; \
ARCH="`uname -m | sed 's!x86_64!amd64!; s!aarch64!arm64!'`"; \
wget -O /usr/local/bin/crun https://github.com/containers/crun/releases/download/$CRUN_VERSION/crun-${CRUN_VERSION}-linux-${ARCH}-disable-systemd; \
Expand All @@ -200,14 +200,15 @@ RUN set -ex; \


# Build podman base image
FROM alpine:3.19 AS podmanbase
FROM alpine:3.20 AS podmanbase
LABEL maintainer=""
RUN apk add --no-cache tzdata ca-certificates
COPY --from=conmon /conmon/bin/conmon /usr/local/lib/podman/conmon
COPY --from=podman /usr/local/lib/podman/rootlessport /usr/local/lib/podman/rootlessport
COPY --from=podman /usr/local/bin/podman /usr/local/bin/podman
COPY --from=passt /passt/bin/ /usr/local/bin/
COPY --from=netavark /netavark/target/release/netavark /usr/local/lib/podman/netavark
COPY --from=passt /passt/bin/pasta /usr/local/bin/pasta
COPY --from=passt /passt/bin/ /usr/local/bin/
COPY conf/containers /etc/containers
RUN set -ex; \
adduser -D podman -h /podman -u 1000; \
Expand All @@ -217,7 +218,7 @@ RUN set -ex; \
ln -s /usr/local/bin/podman /usr/bin/docker; \
mkdir -p /podman/.local/share/containers/storage /var/lib/containers/storage; \
chown -R podman:podman /podman; \
mkdir -m1777 /.local /.config /.cache; \
mkdir -p -m1777 /.local /.config /.cache; \
podman --help >/dev/null; \
/usr/local/lib/podman/conmon --help >/dev/null
ENV _CONTAINERS_USERNS_CONFIGURED=""
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile-remote
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# podman build base
FROM golang:1.22-alpine3.19 AS podmanbuildbase
FROM golang:1.22-alpine3.20 AS podmanbuildbase
RUN apk add --update --no-cache git make gcc pkgconf musl-dev \
btrfs-progs btrfs-progs-dev libassuan-dev lvm2-dev device-mapper \
glib-static libc-dev gpgme-dev protobuf-dev protobuf-c-dev \
Expand All @@ -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=v5.1.2
ARG PODMAN_VERSION=v5.2.1
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 set -eux; \
Expand All @@ -20,6 +20,6 @@ RUN set -eux; \
podman --help >/dev/null; \
[ "$(ldd /usr/local/bin/podman-remote | wc -l)" -eq 0 ] || (ldd /usr/local/bin/podman-remote; false)

FROM alpine:3.19
FROM alpine:3.20
COPY --from=podman-remote /usr/local/bin /usr/local/bin
RUN adduser -D podman-remote -h /podman -u 1000

0 comments on commit b44959b

Please sign in to comment.