From 5258a80c67e92b548c7a53d27be1a30669308521 Mon Sep 17 00:00:00 2001 From: Eljo George Date: Mon, 8 Jan 2024 13:16:23 -0800 Subject: [PATCH] Alpine - Install libssl1.1 only if available (#793) --- src/common-utils/main.sh | 7 ++++++- test/common-utils/alpine-3-18.sh | 16 ++++++++++++++++ test/common-utils/scenarios.json | 7 +++++++ 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100755 test/common-utils/alpine-3-18.sh diff --git a/src/common-utils/main.sh b/src/common-utils/main.sh index 26f0a7512..6214d2580 100644 --- a/src/common-utils/main.sh +++ b/src/common-utils/main.sh @@ -265,7 +265,6 @@ install_alpine_packages() { libstdc++ \ krb5-libs \ libintl \ - libssl1.1 \ lttng-ust \ tzdata \ userspace-rcu \ @@ -279,6 +278,12 @@ install_alpine_packages() { shadow \ strace + # # Include libssl1.1 if available (not available for 3.19 and newer) + LIBSSL1_PKG=libssl1.1 + if [[ $(apk search --no-cache -a $LIBSSL1_PKG | grep $LIBSSL1_PKG) ]]; then + apk add --no-cache $LIBSSL1_PKG + fi + # Install man pages - package name varies between 3.12 and earlier versions if apk info man > /dev/null 2>&1; then apk add --no-cache man man-pages diff --git a/test/common-utils/alpine-3-18.sh b/test/common-utils/alpine-3-18.sh new file mode 100755 index 000000000..eaf384b9e --- /dev/null +++ b/test/common-utils/alpine-3-18.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -e + +# Optional: Import test library +source dev-container-features-test-lib + +# Definition specific tests +. /etc/os-release +check "non-root user" test "$(whoami)" = "devcontainer" +check "distro" test "${ID}" = "alpine" +check "bashrc" ls /etc/bash/bashrc +check "libssl1.1 is installed" grep "libssl1.1" <(apk list --no-cache libssl1.1) + +# Report result +reportResults \ No newline at end of file diff --git a/test/common-utils/scenarios.json b/test/common-utils/scenarios.json index c1ee18dde..eef2bffcd 100644 --- a/test/common-utils/scenarios.json +++ b/test/common-utils/scenarios.json @@ -162,6 +162,13 @@ "common-utils": {} } }, + "alpine-3-18": { + "image": "alpine:3.18", + "remoteUser": "devcontainer", + "features": { + "common-utils": {} + } + }, "devcontainer-info": { "build": { "dockerfile": "Dockerfile"