-
Notifications
You must be signed in to change notification settings - Fork 0
/
cni.Dockerfile.hgvm
59 lines (46 loc) · 2.43 KB
/
cni.Dockerfile.hgvm
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
47
48
49
50
51
52
53
54
55
56
57
58
59
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 quay.io/centos/centos:stream8
LABEL authors="Antoni Segura Puimedon<[email protected]>, Michał Dulko<[email protected]>"
#RUN curl -L --retry 5 https://github.com/containernetworking/plugins/releases/download/v1.1.1/cni-plugins-linux-amd64-v1.1.1.tgz | tar -xz -C / ./loopback ./portmap
RUN tar -xzf cni-plugins-linux-amd64-v1.1.1.tgz -C / ./loopback ./portmap
ARG UPPER_CONSTRAINTS_FILE="https://releases.openstack.org/constraints/upper/xena"
ARG OSLO_LOCK_PATH=/var/kuryr-lock
ARG RDO_REPO=https://repos.fedorapeople.org/repos/openstack/archived/openstack-xena/rdo-release-xena-1.el8.noarch.rpm
# NOTE(gryf): There is a sed substitution to make package manager to
# cooperate. It might be a subject to change in the future, either when
# yum/dnf starts to respect yum.conf variables, or mirror location would
# change.
RUN dnf upgrade -y && dnf install -y epel-release $RDO_REPO \
&& dnf install -y --setopt=tsflags=nodocs python3-pip openvswitch sudo iproute libstdc++ pciutils kmod-libs \
&& dnf install -y --setopt=tsflags=nodocs gcc gcc-c++ python3-devel git
COPY . /opt/kuryr-kubernetes
RUN chmod 777 /opt/kuryr-kubernetes/cni_ds_init
RUN pip3 --no-cache-dir install -U pip \
&& python3 -m pip --no-cache-dir install -c $UPPER_CONSTRAINTS_FILE /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" ]