-
Notifications
You must be signed in to change notification settings - Fork 0
/
cni.Dockerfile.hgvm.base
46 lines (35 loc) · 1.57 KB
/
cni.Dockerfile.hgvm.base
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#FROM golang:1.21-alpine as builder
FROM registry.cn-hangzhou.aliyuncs.com/testwydimage/docker.io.library.golang:1.21-alpine as builder
WORKDIR /go/src/opendev.com/kuryr-kubernetes
COPY . .
RUN export CGO_ENABLED=0 \
&& GO111MODULE=auto go build -o /go/bin/kuryr-cni ./kuryr_cni/pkg/*
RUN cd ./coordinator \
&& export GOPROXY=https://goproxy.cn,direct \
&& go mod tidy \
&& export CGO_ENABLED=0 \
&& GO111MODULE=auto go build -o /go/bin/coordinator .
FROM registry.cn-beijing.aliyuncs.com/killmaster/kuryr-kubernetes:cni-base
ARG OSLO_LOCK_PATH=/var/kuryr-lock
RUN chmod 777 /opt/kuryr-kubernetes/cni_ds_init
RUN cp /opt/kuryr-kubernetes/loopback /loopback
RUN cp /opt/kuryr-kubernetes/portmap /portmap
RUN pip3 --no-cache-dir install -U pip \
&& python3 -m pip --no-cache-dir install -c /opt/kuryr-kubernetes/constraints.txt /opt/kuryr-kubernetes \
&& cp /opt/kuryr-kubernetes/cni_ds_init /usr/bin/cni_ds_init \
&& mkdir -p /etc/kuryr-cni \
&& cp /opt/kuryr-kubernetes/etc/cni/net.d/* /etc/kuryr-cni \
&& dnf -y remove gcc gcc-c++ python3-devel git \
&& dnf clean all \
&& mkdir ${OSLO_LOCK_PATH}
RUN cd /opt/kuryr-kubernetes/keystone/keystoneauth \
&& python3 setup.py install \
&& cd /opt/kuryr-kubernetes/keystone/keystonemiddleware \
&& python3 setup.py install \
&& rm -rf /opt/kuryr-kubernetes
COPY --from=builder /go/bin/kuryr-cni /iveth-cni
COPY --from=builder /go/bin/coordinator /coordinator
ARG CNI_DAEMON=True
ENV CNI_DAEMON=${CNI_DAEMON}
ENV OSLO_LOCK_PATH=${OSLO_LOCK_PATH}
ENTRYPOINT [ "cni_ds_init" ]