Skip to content

Commit d88cbbd

Browse files
committed
Added script to download and install CNI plugin on Linux
1 parent da7dd9c commit d88cbbd

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

build/install-cni-plugin.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/usr/bin/env bash
2+
3+
PLUGIN_VERSION=v0.5
4+
CNI_VERSION=v0.4.0
5+
6+
# Create default CNI directories.
7+
mkdir -p /etc/cni/net.d
8+
mkdir -p /opt/cni/bin
9+
10+
# Install ebtables.
11+
if [ ! -e /sbin/ebtables ]
12+
then
13+
apt-get update
14+
apt-get install -y ebtables
15+
fi
16+
/sbin/ebtables --list
17+
18+
# Install Azure CNI plugins.
19+
/usr/bin/curl -sSL https://github.com/Azure/azure-container-networking/releases/download/${PLUGIN_VERSION}/azure-vnet-amd64-${PLUGIN_VERSION}.tgz > /opt/cni/bin/azure.tgz
20+
tar -xzf /opt/cni/bin/azure.tgz -C /opt/cni/bin
21+
22+
# Install loopback plugin.
23+
/usr/bin/curl -sSL https://github.com/containernetworking/cni/releases/download/${CNI_VERSION}/cni-amd64-${CNI_VERSION}.tgz > /opt/cni/bin/cni.tgz
24+
tar -xzf /opt/cni/bin/cni.tgz -C /opt/cni/bin ./loopback
25+
26+
# Cleanup.
27+
rm /opt/cni/bin/*.tgz
28+
chown root:root /opt/cni/bin/*

0 commit comments

Comments
 (0)