summaryrefslogtreecommitdiffhomepage
path: root/tools/installers/containerd.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tools/installers/containerd.sh')
-rwxr-xr-xtools/installers/containerd.sh31
1 files changed, 20 insertions, 11 deletions
diff --git a/tools/installers/containerd.sh b/tools/installers/containerd.sh
index 6b7bb261c..e598bce89 100755
--- a/tools/installers/containerd.sh
+++ b/tools/installers/containerd.sh
@@ -16,7 +16,7 @@
set -xeo pipefail
-declare -r CONTAINERD_VERSION=${CONTAINERD_VERSION:-1.3.0}
+declare -r CONTAINERD_VERSION=${1:-1.3.0}
declare -r CONTAINERD_MAJOR="$(echo ${CONTAINERD_VERSION} | awk -F '.' '{ print $1; }')"
declare -r CONTAINERD_MINOR="$(echo ${CONTAINERD_VERSION} | awk -F '.' '{ print $2; }')"
@@ -43,10 +43,23 @@ install_helper() {
make install)
}
+# Figure out were btrfs headers are.
+#
+# Ubuntu 16.04 has only btrfs-tools, while 18.04 has a transitional package,
+# and later versions no longer have the transitional package.
+source /etc/os-release
+declare BTRFS_DEV
+if [[ "${VERSION_ID%.*}" -le "18" ]]; then
+ BTRFS_DEV="btrfs-tools"
+else
+ BTRFS_DEV="libbtrfs-dev"
+fi
+readonly BTRFS_DEV
+
# Install dependencies for the crictl tests.
while true; do
if (apt-get update && apt-get install -y \
- btrfs-tools \
+ "${BTRFS_DEV}" \
libseccomp-dev); then
break
fi
@@ -62,14 +75,11 @@ install_helper github.com/containerd/containerd "v${CONTAINERD_VERSION}" "${GOPA
install_helper github.com/kubernetes-sigs/cri-tools "v${CRITOOLS_VERSION}" "${GOPATH}"
# Configure containerd-shim.
-#
-# Note that for versions <= 1.1 the legacy shim must be installed in /usr/bin,
-# which should align with the installer script in head.sh (or master.sh).
-if [[ "${CONTAINERD_MAJOR}" -le 1 ]] && [[ "${CONTAINERD_MINOR}" -lt 2 ]]; then
- declare -r shim_config_path=/etc/containerd/gvisor-containerd-shim.toml
- mkdir -p $(dirname ${shim_config_path})
- cat > ${shim_config_path} <<-EOF
- runc_shim = "/usr/bin/containerd-shim"
+declare -r shim_config_path=/etc/containerd/runsc/config.toml
+mkdir -p $(dirname ${shim_config_path})
+cat > ${shim_config_path} <<-EOF
+log_path = "/tmp/shim-logs/"
+log_level = "debug"
[runsc_config]
debug = "true"
@@ -77,7 +87,6 @@ if [[ "${CONTAINERD_MAJOR}" -le 1 ]] && [[ "${CONTAINERD_MINOR}" -lt 2 ]]; then
strace = "true"
file-access = "shared"
EOF
-fi
# Configure CNI.
(cd "${GOPATH}" && src/github.com/containerd/containerd/script/setup/install-cni)