Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Ubuntu] Remove apt source for podman, buildah and skopeo #3077

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions images/linux/scripts/SoftwareReport/SoftwareReport.Tools.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
14 changes: 12 additions & 2 deletions images/linux/scripts/installers/containers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,25 @@
## Desc: Installs container tools: podman, buildah and skopeo onto the image
################################################################################

# Install podman, buildah, scopeo container's tools
source $HELPER_SCRIPTS/os.sh
dibir-magomedsaygitov marked this conversation as resolved.
Show resolved Hide resolved

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 https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/x${NAME}_${VERSION_ID}/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list"
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

# 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

invoke_tests "Tools" "Containers"