File tree 9 files changed +94
-19
lines changed
9 files changed +94
-19
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,15 @@ RUN set -ex; \
9
9
arm*) binutils=binutils-gold ;; \
10
10
*) binutils=binutils ;; \
11
11
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
+
13
21
14
22
ENV \
15
23
HOME="/run/k0s-build" \
Original file line number Diff line number Diff line change @@ -3,10 +3,20 @@ FROM $BUILDIMAGE AS build
3
3
4
4
ENV GOPATH=/go
5
5
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
10
20
11
21
ARG VERSION
12
22
RUN mkdir -p $GOPATH/src/github.com/containerd/containerd
Original file line number Diff line number Diff line change 1
1
ARG BUILDIMAGE
2
2
FROM $BUILDIMAGE AS build
3
3
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
+
5
13
6
14
ARG VERSION
7
15
RUN cd / && git -c advice.detachedHead=false clone -b v$VERSION --depth=1 https://github.com/etcd-io/etcd.git
Original file line number Diff line number Diff line change 1
1
ARG BUILDIMAGE
2
2
FROM $BUILDIMAGE AS build
3
3
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
8
17
9
18
ARG VERSION
10
19
RUN curl --proto '=https' --tlsv1.2 -L https://www.netfilter.org/projects/iptables/files/iptables-$VERSION.tar.xz \
Original file line number Diff line number Diff line change 1
1
ARG BUILDIMAGE
2
2
FROM $BUILDIMAGE AS build
3
3
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
8
17
9
18
ARG VERSION
10
19
RUN curl --proto '=https' --tlsv1.2 -L https://www.keepalived.org/software/keepalived-$VERSION.tar.gz \
Original file line number Diff line number Diff line change 1
1
ARG BUILDIMAGE
2
2
FROM $BUILDIMAGE AS build
3
3
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
5
12
6
13
ARG VERSION
7
14
RUN cd / && git -c advice.detachedHead=false clone -b v$VERSION --depth=1 https://github.com/rancher/kine.git
Original file line number Diff line number Diff line change 1
1
ARG BUILDIMAGE
2
2
FROM $BUILDIMAGE AS build
3
3
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
5
12
6
13
ARG VERSION
7
14
RUN git -c advice.detachedHead=false clone -b v$VERSION --depth=1 https://github.com/kubernetes-sigs/apiserver-network-proxy.git /apiserver-network-proxy
Original file line number Diff line number Diff line change @@ -2,7 +2,15 @@ ARG BUILDIMAGE
2
2
FROM $BUILDIMAGE AS build
3
3
4
4
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
6
14
7
15
RUN mkdir -p $GOPATH/src/github.com/kubernetes/kubernetes
8
16
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
54
47
55
FROM scratch
48
56
COPY --from=build out/* /bin/
57
+
Original file line number Diff line number Diff line change 1
1
ARG BUILDIMAGE
2
2
FROM $BUILDIMAGE AS build
3
3
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
6
14
7
15
ENV GOPATH=/go
8
16
You can’t perform that action at this time.
0 commit comments