Common-utils: Fix build failures for alpine 3.14 & 3.15 (#393)

* Common-utils: Fix build failures for alpine 3.14 & 3.15

* version bump
This commit is contained in:
Samruddhi Khandale 2023-01-10 15:09:56 -08:00 committed by GitHub
parent c8f5c3cbee
commit e67f4dc0fd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 47 additions and 1 deletions

View file

@ -1,6 +1,6 @@
{ {
"id": "common-utils", "id": "common-utils",
"version": "2.0.5", "version": "2.0.6",
"name": "Common Utilities", "name": "Common Utilities",
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/common-utils", "documentationURL": "https://github.com/devcontainers/features/tree/main/src/common-utils",
"description": "Installs a set of common command line utilities, Oh My Zsh!, and sets up a non-root user.", "description": "Installs a set of common command line utilities, Oh My Zsh!, and sets up a non-root user.",

View file

@ -407,6 +407,8 @@ if [ "${RC_SNIPPET_ALREADY_ADDED}" != "true" ]; then
;; ;;
"alpine") "alpine")
global_rc_path="/etc/bash/bashrc" global_rc_path="/etc/bash/bashrc"
# /etc/bash/bashrc does not exist in alpine 3.14 & 3.15
mkdir -p /etc/bash
;; ;;
esac esac
cat "${FEATURE_DIR}/scripts/rc_snippet.sh" >> ${global_rc_path} cat "${FEATURE_DIR}/scripts/rc_snippet.sh" >> ${global_rc_path}

View file

@ -0,0 +1,15 @@
#!/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
# Report result
reportResults

View file

@ -0,0 +1,15 @@
#!/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
# Report result
reportResults

View file

@ -115,6 +115,20 @@
} }
} }
}, },
"alpine-3-14": {
"image": "alpine:3.14",
"remoteUser": "devcontainer",
"features": {
"common-utils": {}
}
},
"alpine-3-15": {
"image": "alpine:3.15",
"remoteUser": "devcontainer",
"features": {
"common-utils": {}
}
},
"devcontainer-info": { "devcontainer-info": {
"build": { "build": {
"dockerfile": "Dockerfile" "dockerfile": "Dockerfile"