Skip to content

Commit cf3d6ca

Browse files
authored
Merge pull request #5703 from makhov/backport-5697-to-release-1.31
[Backport release-1.31] Debian-based distros support in the build pipeline
2 parents 98b6c07 + 8aa6740 commit cf3d6ca

File tree

9 files changed

+94
-19
lines changed

9 files changed

+94
-19
lines changed

build/Dockerfile

+9-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,15 @@ RUN set -ex; \
99
arm*) binutils=binutils-gold ;; \
1010
*) binutils=binutils ;; \
1111
esac; \
12-
apk add --no-cache make gcc musl-dev "$binutils"
12+
if [ ! -z "$(which apt)" ]; then \
13+
apt update && apt install -y make gcc; \
14+
elif [ ! -z "$(which apk)" ]; then \
15+
apk add --no-cache make gcc musl-dev "$binutils"; \
16+
else \
17+
echo "unsupported package manager"; \
18+
exit 1; \
19+
fi
20+
1321

1422
ENV \
1523
HOME="/run/k0s-build" \

embedded-bins/containerd/Dockerfile

+14-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,20 @@ FROM $BUILDIMAGE AS build
33

44
ENV GOPATH=/go
55

6-
RUN apk upgrade -U -a && apk add \
7-
build-base git \
8-
btrfs-progs-dev btrfs-progs-static \
9-
protoc bash
6+
RUN if [ ! -z "$(which apt)" ]; then \
7+
apt update && apt install -y \
8+
build-essential git \
9+
btrfs-progs protobuf-compiler \
10+
bash; \
11+
elif [ ! -z "$(which apk)" ]; then \
12+
apk upgrade -U -a && apk add \
13+
build-base git \
14+
btrfs-progs-dev btrfs-progs-static \
15+
protoc bash; \
16+
else \
17+
echo "unsupported package manager"; \
18+
exit 1; \
19+
fi
1020

1121
ARG VERSION
1222
RUN mkdir -p $GOPATH/src/github.com/containerd/containerd

embedded-bins/etcd/Dockerfile

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
ARG BUILDIMAGE
22
FROM $BUILDIMAGE AS build
33

4-
RUN apk add build-base git
4+
RUN if [ ! -z "$(which apt)" ]; then \
5+
apt update && apt install -y build-essential git; \
6+
elif [ ! -z "$(which apk)" ]; then \
7+
apk add build-base git; \
8+
else \
9+
echo "unsupported package manager"; \
10+
exit 1; \
11+
fi
12+
513

614
ARG VERSION
715
RUN cd / && git -c advice.detachedHead=false clone -b v$VERSION --depth=1 https://github.com/etcd-io/etcd.git

embedded-bins/iptables/Dockerfile

+13-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
ARG BUILDIMAGE
22
FROM $BUILDIMAGE AS build
33

4-
RUN apk add build-base curl pkgconf \
5-
linux-headers \
6-
libmnl-dev libmnl-static \
7-
libnftnl-dev
4+
RUN if [ ! -z "$(which apt)" ]; then \
5+
apt update && apt install -y build-essential curl \
6+
pkg-config \
7+
libmnl-dev libnftnl-dev; \
8+
elif [ ! -z "$(which apk)" ]; then \
9+
apk add build-base curl pkgconf \
10+
linux-headers \
11+
libmnl-dev libmnl-static \
12+
libnftnl-dev; \
13+
else \
14+
echo "unsupported package manager"; \
15+
exit 1; \
16+
fi
817

918
ARG VERSION
1019
RUN curl --proto '=https' --tlsv1.2 -L https://www.netfilter.org/projects/iptables/files/iptables-$VERSION.tar.xz \

embedded-bins/keepalived/Dockerfile

+13-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
ARG BUILDIMAGE
22
FROM $BUILDIMAGE AS build
33

4-
RUN apk add build-base curl \
5-
linux-headers \
6-
openssl-dev openssl-libs-static \
7-
libnl3-dev libnl3-static
4+
RUN if [ ! -z "$(which apt)" ]; then \
5+
apt update && apt install -y build-essential curl \
6+
openssl libssl-dev \
7+
libnl-3-dev libnl-3-200 libnl-genl-3-dev; \
8+
elif [ ! -z "$(which apk)" ]; then \
9+
apk add build-base curl \
10+
linux-headers \
11+
openssl-dev openssl-libs-static \
12+
libnl3-dev libnl3-static; \
13+
else \
14+
echo "unsupported package manager"; \
15+
exit 1; \
16+
fi
817

918
ARG VERSION
1019
RUN curl --proto '=https' --tlsv1.2 -L https://www.keepalived.org/software/keepalived-$VERSION.tar.gz \

embedded-bins/kine/Dockerfile

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
ARG BUILDIMAGE
22
FROM $BUILDIMAGE AS build
33

4-
RUN apk add build-base git
4+
RUN if [ ! -z "$(which apt)" ]; then \
5+
apt update && apt install -y build-essential git; \
6+
elif [ ! -z "$(which apk)" ]; then \
7+
apk add build-base git; \
8+
else \
9+
echo "unsupported package manager"; \
10+
exit 1; \
11+
fi
512

613
ARG VERSION
714
RUN cd / && git -c advice.detachedHead=false clone -b v$VERSION --depth=1 https://github.com/rancher/kine.git

embedded-bins/konnectivity/Dockerfile

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
ARG BUILDIMAGE
22
FROM $BUILDIMAGE AS build
33

4-
RUN apk add build-base git make protoc
4+
RUN if [ ! -z "$(which apt)" ]; then \
5+
apt update && apt install -y build-essential make protobuf-compiler git; \
6+
elif [ ! -z "$(which apk)" ]; then \
7+
apk add build-base git make protoc; \
8+
else \
9+
echo "unsupported package manager"; \
10+
exit 1; \
11+
fi
512

613
ARG VERSION
714
RUN git -c advice.detachedHead=false clone -b v$VERSION --depth=1 https://github.com/kubernetes-sigs/apiserver-network-proxy.git /apiserver-network-proxy

embedded-bins/kubernetes/Dockerfile

+10-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,15 @@ ARG BUILDIMAGE
22
FROM $BUILDIMAGE AS build
33

44
ARG VERSION
5-
RUN apk add build-base git linux-headers rsync grep coreutils bash
5+
6+
RUN if [ ! -z "$(which apt)" ]; then \
7+
apt update && apt install -y build-essential git rsync grep coreutils bash; \
8+
elif [ ! -z "$(which apk)" ]; then \
9+
apk add build-base git linux-headers rsync grep coreutils bash; \
10+
else \
11+
echo "unsupported package manager"; \
12+
exit 1; \
13+
fi
614

715
RUN mkdir -p $GOPATH/src/github.com/kubernetes/kubernetes
816
RUN git -c advice.detachedHead=false clone -b v$VERSION --depth=1 https://github.com/kubernetes/kubernetes.git $GOPATH/src/github.com/kubernetes/kubernetes
@@ -46,3 +54,4 @@ RUN \
4654

4755
FROM scratch
4856
COPY --from=build out/* /bin/
57+

embedded-bins/runc/Dockerfile

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
ARG BUILDIMAGE
22
FROM $BUILDIMAGE AS build
33

4-
RUN apk add build-base git \
5-
curl linux-headers gperf bash pkgconf cmd:tail
4+
RUN if [ ! -z "$(which apt)" ]; then \
5+
apt update && apt install -y build-essential git \
6+
curl gperf bash pkg-config; \
7+
elif [ ! -z "$(which apk)" ]; then \
8+
apk add build-base git \
9+
curl linux-headers gperf bash pkgconf cmd:tail; \
10+
else \
11+
echo "unsupported package manager"; \
12+
exit 1; \
13+
fi
614

715
ENV GOPATH=/go
816

0 commit comments

Comments
 (0)