Skip to content

Commit

Permalink
Alpine - Install libssl1.1 only if available (#793)
Browse files Browse the repository at this point in the history
  • Loading branch information
eljog authored Jan 8, 2024
1 parent 3ea4d6b commit 5258a80
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/common-utils/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,6 @@ install_alpine_packages() {
libstdc++ \
krb5-libs \
libintl \
libssl1.1 \
lttng-ust \
tzdata \
userspace-rcu \
Expand All @@ -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
Expand Down
16 changes: 16 additions & 0 deletions test/common-utils/alpine-3-18.sh
Original file line number Diff line number Diff line change
@@ -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
7 changes: 7 additions & 0 deletions test/common-utils/scenarios.json
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,13 @@
"common-utils": {}
}
},
"alpine-3-18": {
"image": "alpine:3.18",
"remoteUser": "devcontainer",
"features": {
"common-utils": {}
}
},
"devcontainer-info": {
"build": {
"dockerfile": "Dockerfile"
Expand Down

0 comments on commit 5258a80

Please sign in to comment.