2020-10-07 13:49:40 +05:00
|
|
|
#!/bin/bash -e
|
2020-01-24 19:51:04 +00:00
|
|
|
################################################################################
|
|
|
|
|
## File: containers.sh
|
|
|
|
|
## Desc: Installs container tools: podman, buildah and skopeo onto the image
|
|
|
|
|
################################################################################
|
|
|
|
|
|
2022-05-25 20:25:12 +04:00
|
|
|
source $HELPER_SCRIPTS/os.sh
|
|
|
|
|
|
2020-12-02 18:46:08 +07:00
|
|
|
install_packages=(podman buildah skopeo)
|
2021-04-08 14:13:21 +03:00
|
|
|
|
2022-05-25 20:25:12 +04:00
|
|
|
# Packages is available in the official Ubuntu upstream starting from Ubuntu 21
|
|
|
|
|
if isUbuntu18 || isUbuntu20; then
|
|
|
|
|
REPO_URL="https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable"
|
|
|
|
|
source /etc/os-release
|
|
|
|
|
sh -c "echo 'deb ${REPO_URL}/x${NAME}_${VERSION_ID}/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list"
|
|
|
|
|
wget -qnv https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/x${NAME}_${VERSION_ID}/Release.key -O Release.key
|
|
|
|
|
apt-key add Release.key
|
|
|
|
|
fi
|
|
|
|
|
|
2022-05-20 15:40:31 +02:00
|
|
|
# Install podman, buildah, scopeo container's tools
|
2022-05-25 20:25:12 +04:00
|
|
|
apt-get update
|
|
|
|
|
apt-get -y install ${install_packages[@]}
|
2020-01-24 19:51:04 +00:00
|
|
|
mkdir -p /etc/containers
|
|
|
|
|
echo -e "[registries.search]\nregistries = ['docker.io', 'quay.io']" | tee /etc/containers/registries.conf
|
2020-12-02 18:46:08 +07:00
|
|
|
|
2022-05-25 20:25:12 +04:00
|
|
|
if isUbuntu18 || isUbuntu20; then
|
|
|
|
|
# Remove source repo
|
|
|
|
|
rm /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
|
|
|
|
|
# Document source repo
|
|
|
|
|
echo "containers $REPO_URL" >> $HELPER_SCRIPTS/apt-sources.txt
|
|
|
|
|
fi
|
|
|
|
|
|
2021-02-18 09:03:13 +03:00
|
|
|
invoke_tests "Tools" "Containers"
|