Skip to content

Commit 84ab9fa

Browse files
Upgrade versions; Slim down hook-docker: (#275)
## Description <!--- Please describe what this PR is going to change --> - Go to 1.24. Containerd to v2.1.3. Runc to v1.3.0. Docker to 28.2.2. - Slimmed down hook-docker and got us back about 20Mb. This was needed as the new version of docker was larger than the previous and hook-udev increased the overall size too. - Fixed issue with `dhcp.sh` script and udev interface naming for Raspberry PI 4b machines and other machines that udev names the interface as `eth` instead of `en`. - Slimmed down hook-bootkit by using scratch. ## Why is this needed <!--- Link to issue you have raised --> Fixes: # ## How Has This Been Tested? <!--- Please describe in detail how you tested your changes. --> <!--- Include details of your testing environment, and the tests you ran to --> <!--- see how your change affects other areas of the code, etc. --> ## How are existing users impacted? What migration steps/scripts do we need? <!--- Fixes a bug, unblocks installation, removes a component of the stack etc --> <!--- Requires a DB migration script, etc. --> ## Checklist: I have: - [ ] updated the documentation and/or roadmap (if required) - [ ] added unit or e2e tests - [ ] provided instructions on how to upgrade
2 parents 813fe44 + 1aa5fc0 commit 84ab9fa

File tree

7 files changed

+219
-257
lines changed

7 files changed

+219
-257
lines changed

files/dhcp.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ set -x
99

1010
run_dhcp_client() {
1111
one_shot="$1"
12-
al="en*"
12+
al="e*"
1313

1414
vlan_id=$(sed -n 's/.* vlan_id=\([0-9]*\).*/\1/p' /proc/cmdline)
1515
if [ -n "$vlan_id" ]; then
16-
al="en*.*"
16+
al="e*.*"
1717
fi
1818

1919
if [ "$one_shot" = "true" ]; then

images/hook-bootkit/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
FROM golang:1.22.6-alpine AS dev
1+
FROM golang:1.24-alpine AS dev
22
COPY . /src/
33
WORKDIR /src
44
RUN go mod download
55
RUN CGO_ENABLED=0 go build -a -ldflags '-s -w -extldflags "-static"' -o /bootkit
66

7-
FROM alpine
7+
FROM scratch
88
COPY --from=dev /bootkit .
99
ENTRYPOINT ["/bootkit"]

images/hook-containerd/Dockerfile

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM linuxkit/alpine:146f540f25cd92ec8ff0c5b0c98342a9a95e479e AS builder
1+
FROM alpine:3.22 AS builder
22

33
ARG TARGETPLATFORM
44

@@ -7,38 +7,38 @@ ARG TARGETPLATFORM
77
# `test/pkg/containerd/Dockerfile` when changing this.
88
ENV CONTAINERD_REPO=https://github.com/containerd/containerd.git
99

10-
ENV CONTAINERD_COMMIT=v1.7.15
11-
ENV NERDCTL_VERSION=1.7.6
10+
ENV CONTAINERD_COMMIT=v2.1.3
11+
ENV NERDCTL_VERSION=2.1.2
1212
ENV GOPATH=/go
13-
RUN apk add go git
13+
RUN apk add go=1.24.4-r0 git
1414
RUN mkdir -p $GOPATH/src/github.com/containerd && \
1515
cd $GOPATH/src/github.com/containerd && \
1616
git clone https://github.com/containerd/containerd.git && \
1717
cd $GOPATH/src/github.com/containerd/containerd && \
1818
git checkout $CONTAINERD_COMMIT
1919
RUN apk add --no-cache btrfs-progs-dev gcc libc-dev linux-headers make libseccomp-dev
2020
WORKDIR $GOPATH/src/github.com/containerd/containerd
21-
RUN make binaries EXTRA_FLAGS="-buildmode pie" EXTRA_LDFLAGS='-w -s -extldflags "-fno-PIC -static"' BUILDTAGS="static_build no_devmapper"
21+
RUN make binaries STATIC=1 EXTRA_FLAGS="-buildmode pie" EXTRA_LDFLAGS='-w -s -extldflags "-fno-PIC -static"' BUILDTAGS="static_build no_devmapper"
2222

2323
# install nerdctl
2424
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then ARCHITECTURE=amd64; elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then ARCHITECTURE=arm64; else ARCHITECTURE=amd64; fi \
2525
&& wget https://github.com/containerd/nerdctl/releases/download/v${NERDCTL_VERSION}/nerdctl-${NERDCTL_VERSION}-linux-${ARCHITECTURE}.tar.gz \
2626
&& tar -zxvf nerdctl-${NERDCTL_VERSION}-linux-${ARCHITECTURE}.tar.gz -C /usr/local/bin/
2727

28-
RUN cp bin/containerd bin/ctr bin/containerd-shim bin/containerd-shim-runc-v2 /usr/bin/
29-
RUN strip /usr/bin/containerd /usr/bin/ctr /usr/bin/containerd-shim /usr/bin/containerd-shim-runc-v2
28+
RUN cp bin/containerd bin/ctr bin/containerd-shim-runc-v2 /usr/bin/
29+
RUN strip /usr/bin/containerd /usr/bin/ctr /usr/bin/containerd-shim-runc-v2
3030
RUN mkdir -p /opt/containerd
3131

3232
FROM scratch AS containerd-dev
3333
ENTRYPOINT []
3434
WORKDIR /
35-
COPY --from=builder /usr/bin/containerd /usr/bin/ctr /usr/bin/containerd-shim /usr/bin/containerd-shim-runc-v2 /usr/bin/
35+
COPY --from=builder /usr/bin/containerd /usr/bin/ctr /usr/bin/containerd-shim-runc-v2 /usr/bin/
3636
COPY --from=builder /go/src/github.com/containerd/containerd /go/src/github.com/containerd/containerd
3737
COPY --from=builder /usr/local/bin/nerdctl /usr/bin/
3838
COPY --from=builder /opt/containerd/ /opt/containerd/
3939

4040
# Dockerfile to build linuxkit/containerd for linuxkit
41-
FROM linuxkit/alpine:146f540f25cd92ec8ff0c5b0c98342a9a95e479e AS alpine
41+
FROM alpine:3.22 AS alpine
4242

4343
RUN apk add tzdata binutils
4444
RUN mkdir -p /etc/init.d && ln -s /usr/bin/service /etc/init.d/020-containerd
@@ -48,7 +48,7 @@ FROM containerd-dev
4848
FROM scratch
4949
ENTRYPOINT []
5050
WORKDIR /
51-
COPY --from=containerd-dev /usr/bin/containerd /usr/bin/ctr /usr/bin/containerd-shim /usr/bin/containerd-shim-runc-v2 /usr/bin/
51+
COPY --from=containerd-dev /usr/bin/containerd /usr/bin/ctr /usr/bin/containerd-shim-runc-v2 /usr/bin/
5252
COPY --from=containerd-dev /usr/bin/nerdctl /usr/bin/
5353
COPY --from=containerd-dev /opt/containerd/ /opt/containerd/
5454
COPY --from=alpine /usr/share/zoneinfo/UTC /etc/localtime

0 commit comments

Comments
 (0)