-
Notifications
You must be signed in to change notification settings - Fork 450
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Debian: Add debian docker image support
Add debian docker image support, this patch works with patch in ovn repo "debian: fix ovn debian packaging and split from openvswitch" Also, as debian default shell is not bash, set install script cmd to bash.
- Loading branch information
Wan Junjie
committed
Dec 10, 2020
1 parent
e36024c
commit a54bfc2
Showing
2 changed files
with
87 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# syntax = docker/dockerfile:experimental | ||
FROM debian:10 as ovs-builder | ||
|
||
ARG RPM_ARCH | ||
ARG ARCH | ||
|
||
ENV REV="buster" | ||
ENV SRC_DIR='/usr/src' | ||
|
||
RUN apt update && apt install build-essential git libnuma-dev autoconf curl \ | ||
python3 libmnl-dev libpcap-dev libtool libcap-ng-dev libssl-dev pkg-config \ | ||
python3-six libunbound-dev libunwind-dev dh-make fakeroot debhelper dh-python \ | ||
flake8 python3-sphinx graphviz groff -y | ||
|
||
RUN cd /usr/src/ && \ | ||
git clone -b branch-2.14 --depth=1 https://github.com/alauda/ovs ovs && \ | ||
cd ovs && ./boot.sh && \ | ||
DATAPATH_CONFIGURE_OPTS='--prefix=/usr --disable-ssl --enable-shared' DEB_BUILD_OPTIONS='parallel=8 nocheck' fakeroot debian/rules binary | ||
|
||
RUN cd /usr/src/ && git clone -b branch-20.06 https://github.com/alauda/ovn.git && \ | ||
cd ovn && \ | ||
curl https://github.com/alauda/ovn/commit/1aa47202c3e09f610ebefe00ab23a0723059bbf3.patch | git apply && \ | ||
curl https://github.com/alauda/ovn/commit/b75eb1f231da55d1b8a29f386dc56234e2eb9d35.patch | git apply && \ | ||
curl https://github.com/alauda/ovn/commit/7fe4df711930ac827619fe8850d56f16a1ee4d0f.patch | git apply && \ | ||
./boot.sh && \ | ||
DATAPATH_CONFIGURE_OPTS='--prefix=/usr --with-ovs-source=/usr/src/ovs' DEB_BUILD_OPTIONS='parallel=8 nocheck' fakeroot debian/rules binary | ||
|
||
RUN mkdir /packages/ && \ | ||
cp /usr/src/libopenvswitch*.deb /packages && \ | ||
cp /usr/src/openvswitch-*.deb /packages && \ | ||
cp /usr/src/python3-openvswitch*.deb /packages && \ | ||
cp /usr/src/ovn-*.deb /packages && \ | ||
cd /packages && rm -f *dbg* *datapath* *docker* *vtep* *ipsec* *test* *dev* | ||
|
||
FROM debian:10 | ||
|
||
ENV REV="buster" | ||
ARG RPM_ARCH | ||
|
||
|
||
RUN apt update && apt install python3 hostname libunwind8 netbase \ | ||
ethtool iproute2 ncat libunbound-dev procps libatomic1 kmod \ | ||
tcpdump ipset curl uuid-runtime libssl-dev \ | ||
python3-six python3-zope.interface -y | ||
|
||
RUN mkdir -p /var/run/openvswitch && \ | ||
mkdir -p /var/run/ovn && \ | ||
mkdir -p /etc/cni/net.d && \ | ||
mkdir -p /opt/cni/bin | ||
|
||
ARG ARCH | ||
ENV CNI_VERSION=v0.8.6 | ||
RUN curl -sSf -L --retry 5 https://github.com/containernetworking/plugins/releases/download/${CNI_VERSION}/cni-plugins-linux-${ARCH}-${CNI_VERSION}.tgz | tar -xz -C . ./loopback ./portmap | ||
|
||
ENV KUBE_VERSION="v1.13.2" | ||
|
||
RUN curl -L https://dl.k8s.io/${KUBE_VERSION}/kubernetes-client-linux-${ARCH}.tar.gz | tar -xz -C . && cp ./kubernetes/client/bin/kubectl /usr/bin/kubectl \ | ||
&& chmod +x /usr/bin/kubectl && rm -rf ./kubernetes | ||
|
||
RUN --mount=type=bind,target=/packages,from=ovs-builder,source=/packages \ | ||
dpkg -i /packages/libopenvswitch*.deb && \ | ||
dpkg -i /packages/openvswitch-*.deb && \ | ||
dpkg -i /packages/python3-openvswitch*.deb &&\ | ||
dpkg -i /packages/ovn-*.deb && \ | ||
cp -f /packages/ovn-*.deb /root/ | ||
|
||
COPY *.sh /kube-ovn/ | ||
COPY 01-kube-ovn.conflist /kube-ovn/01-kube-ovn.conflist | ||
|
||
WORKDIR /kube-ovn | ||
|
||
COPY kube-ovn-speaker /kube-ovn/kube-ovn-speaker | ||
COPY kube-ovn-pinger /kube-ovn/kube-ovn-pinger | ||
COPY kube-ovn /kube-ovn/kube-ovn | ||
COPY kube-ovn-daemon /kube-ovn/kube-ovn-daemon | ||
COPY kube-ovn-controller /kube-ovn/kube-ovn-controller |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters