-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
28 lines (21 loc) · 844 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
FROM golang as builder
COPY . /go/src/github.com/pikeszfish/simplest-cni/
WORKDIR /go/src/github.com/pikeszfish/simplest-cni/
RUN mkdir -p /dist
COPY k8s-install/bridge /dist
COPY k8s-install/host-local /dist
COPY k8s-install/loopback /dist
COPY k8s-install/portmap /dist
COPY k8s-install/scripts/install-cni.sh /dist
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \
go build -ldflags "-X main.buildstamp=`date '+%Y-%m-%d_%I:%M:%S'`" \
-a -v -o /dist/simplest-cni github.com/pikeszfish/simplest-cni
######
FROM alpine:latest
COPY --from=builder /dist/bridge /opt/cni/bin/
COPY --from=builder /dist/host-local /opt/cni/bin/
COPY --from=builder /dist/loopback /opt/cni/bin/
COPY --from=builder /dist/portmap /opt/cni/bin/
RUN apk add --update bash
COPY --from=builder /dist/install-cni.sh /
COPY --from=builder /dist/simplest-cni /