From cb4920fefabdbc729394338a10f01e02783de983 Mon Sep 17 00:00:00 2001 From: Dibir Magomedsaygitov Date: Thu, 1 Apr 2021 13:15:01 +0300 Subject: [PATCH 1/4] remove apt source list --- images/linux/scripts/installers/containers.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/images/linux/scripts/installers/containers.sh b/images/linux/scripts/installers/containers.sh index 3ae559f68348..5f5b9230981a 100644 --- a/images/linux/scripts/installers/containers.sh +++ b/images/linux/scripts/installers/containers.sh @@ -4,6 +4,8 @@ ## Desc: Installs container tools: podman, buildah and skopeo onto the image ################################################################################ +source $HELPER_SCRIPTS/os.sh + # Install podman, buildah, scopeo container's tools install_packages=(podman buildah skopeo) source /etc/os-release @@ -15,4 +17,8 @@ apt-get -qq -y install ${install_packages[@]} mkdir -p /etc/containers echo -e "[registries.search]\nregistries = ['docker.io', 'quay.io']" | tee /etc/containers/registries.conf +if isUbuntu20 ; then + rm /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list +fi + invoke_tests "Tools" "Containers" From 9caf0bea4f5a10e9fbb57b41e136ed44172eda30 Mon Sep 17 00:00:00 2001 From: Dibir Magomedsaygitov Date: Sun, 4 Apr 2021 23:52:42 +0300 Subject: [PATCH 2/4] debug --- images/linux/scripts/installers/containers.sh | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/images/linux/scripts/installers/containers.sh b/images/linux/scripts/installers/containers.sh index 5f5b9230981a..8be0ec882ee6 100644 --- a/images/linux/scripts/installers/containers.sh +++ b/images/linux/scripts/installers/containers.sh @@ -6,19 +6,21 @@ source $HELPER_SCRIPTS/os.sh -# Install podman, buildah, scopeo container's tools install_packages=(podman buildah skopeo) -source /etc/os-release -sh -c "echo 'deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/x${NAME}_${VERSION_ID}/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list" -wget -nv https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/x${NAME}_${VERSION_ID}/Release.key -O Release.key -apt-key add Release.key -apt-get update -qq -apt-get -qq -y install ${install_packages[@]} -mkdir -p /etc/containers -echo -e "[registries.search]\nregistries = ['docker.io', 'quay.io']" | tee /etc/containers/registries.conf +# Install podman, buildah, scopeo container's tools (on Ubuntu20 these tools can be installed without adding new repository) if isUbuntu20 ; then - rm /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list + apt-get -y update + apt-get -qq -y install ${install_packages[@]} +else + source /etc/os-release + sh -c "echo 'deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/x${NAME}_${VERSION_ID}/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list" + wget -nv https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/x${NAME}_${VERSION_ID}/Release.key -O Release.key + apt-key add Release.key + apt-get update -qq + apt-get -qq -y install ${install_packages[@]} + mkdir -p /etc/containers + echo -e "[registries.search]\nregistries = ['docker.io', 'quay.io']" | tee /etc/containers/registries.conf fi invoke_tests "Tools" "Containers" From 01acdc7a987530e3f7a526a9e455ea455edc42b6 Mon Sep 17 00:00:00 2001 From: Dibir Magomedsaygitov Date: Wed, 7 Apr 2021 15:19:48 +0300 Subject: [PATCH 3/4] document source repo and fix installation --- .../SoftwareReport/SoftwareReport.Tools.psm1 | 9 ++++--- images/linux/scripts/installers/containers.sh | 26 +++++++++++-------- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/images/linux/scripts/SoftwareReport/SoftwareReport.Tools.psm1 b/images/linux/scripts/SoftwareReport/SoftwareReport.Tools.psm1 index deab9dcd7e08..7e8dcfe32c05 100644 --- a/images/linux/scripts/SoftwareReport/SoftwareReport.Tools.psm1 +++ b/images/linux/scripts/SoftwareReport/SoftwareReport.Tools.psm1 @@ -34,17 +34,20 @@ function Get-CodeQLBundleVersion { function Get-PodManVersion { $podmanVersion = podman --version | Take-OutputPart -Part 2 - return "Podman $podmanVersion" + $aptSourceRepo = Get-AptSourceRepository -PackageName "containers" + return "Podman $podmanVersion (apt source repository: $aptSourceRepo)" } function Get-BuildahVersion { $buildahVersion = buildah --version | Take-OutputPart -Part 2 - return "Buildah $buildahVersion" + $aptSourceRepo = Get-AptSourceRepository -PackageName "containers" + return "Buildah $buildahVersion (apt source repository: $aptSourceRepo)" } function Get-SkopeoVersion { $skopeoVersion = skopeo --version | Take-OutputPart -Part 2 - return "Skopeo $skopeoVersion" + $aptSourceRepo = Get-AptSourceRepository -PackageName "containers" + return "Skopeo $skopeoVersion (apt source repository: $aptSourceRepo)" } function Get-CMakeVersion { diff --git a/images/linux/scripts/installers/containers.sh b/images/linux/scripts/installers/containers.sh index d3aaf90af049..8316f0c4529f 100644 --- a/images/linux/scripts/installers/containers.sh +++ b/images/linux/scripts/installers/containers.sh @@ -7,20 +7,24 @@ source $HELPER_SCRIPTS/os.sh install_packages=(podman buildah skopeo) +REPO_URL="https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable" # Install podman, buildah, scopeo container's tools (on Ubuntu20 these tools can be installed without adding new repository) +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 +apt-get update -qq +apt-get -qq -y install ${install_packages[@]} +mkdir -p /etc/containers +echo -e "[registries.search]\nregistries = ['docker.io', 'quay.io']" | tee /etc/containers/registries.conf + +# We can safely remove source repo on Ubuntu20 if isUbuntu20 ; then - apt-get -y update - apt-get -qq -y install ${install_packages[@]} -else - source /etc/os-release - sh -c "echo 'deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/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 - apt-get update -qq - apt-get -qq -y install ${install_packages[@]} - mkdir -p /etc/containers - echo -e "[registries.search]\nregistries = ['docker.io', 'quay.io']" | tee /etc/containers/registries.conf + rm /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list fi +# Document source repo +echo "containers $REPO_URL" >> $HELPER_SCRIPTS/apt-sources.txt + invoke_tests "Tools" "Containers" From bb2e05e1ead49e4ce4d8d772577d0274e12e51f5 Mon Sep 17 00:00:00 2001 From: Dibir Magomedsaygitov Date: Wed, 7 Apr 2021 19:55:38 +0300 Subject: [PATCH 4/4] small fix --- images/linux/scripts/installers/containers.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/images/linux/scripts/installers/containers.sh b/images/linux/scripts/installers/containers.sh index 8316f0c4529f..edeb0f78b942 100644 --- a/images/linux/scripts/installers/containers.sh +++ b/images/linux/scripts/installers/containers.sh @@ -19,10 +19,8 @@ apt-get -qq -y install ${install_packages[@]} mkdir -p /etc/containers echo -e "[registries.search]\nregistries = ['docker.io', 'quay.io']" | tee /etc/containers/registries.conf -# We can safely remove source repo on Ubuntu20 -if isUbuntu20 ; then - rm /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list -fi +# 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