diff options
author | Samruddhi Khandale <skhandale@microsoft.com> | 2023-01-11 02:09:56 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-11 02:09:56 +0300 |
commit | e67f4dc0fd053d7bac56a8c802b3a1af68da5bf6 (patch) | |
tree | 996ceb831efc9964b9f94cff9554938f99ea22bc | |
parent | c8f5c3cbee6893b7e7bb970adfa96c54dea8e626 (diff) |
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
-rw-r--r-- | src/common-utils/devcontainer-feature.json | 2 | ||||
-rw-r--r-- | src/common-utils/main.sh | 2 | ||||
-rwxr-xr-x | test/common-utils/alpine-3-14.sh | 15 | ||||
-rwxr-xr-x | test/common-utils/alpine-3-15.sh | 15 | ||||
-rw-r--r-- | test/common-utils/scenarios.json | 14 |
5 files changed, 47 insertions, 1 deletions
diff --git a/src/common-utils/devcontainer-feature.json b/src/common-utils/devcontainer-feature.json index 82623f9..36c87bc 100644 --- a/src/common-utils/devcontainer-feature.json +++ b/src/common-utils/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "common-utils", - "version": "2.0.5", + "version": "2.0.6", "name": "Common Utilities", "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.", diff --git a/src/common-utils/main.sh b/src/common-utils/main.sh index 7cc9409..ff2c54c 100644 --- a/src/common-utils/main.sh +++ b/src/common-utils/main.sh @@ -407,6 +407,8 @@ if [ "${RC_SNIPPET_ALREADY_ADDED}" != "true" ]; then ;; "alpine") global_rc_path="/etc/bash/bashrc" + # /etc/bash/bashrc does not exist in alpine 3.14 & 3.15 + mkdir -p /etc/bash ;; esac cat "${FEATURE_DIR}/scripts/rc_snippet.sh" >> ${global_rc_path} diff --git a/test/common-utils/alpine-3-14.sh b/test/common-utils/alpine-3-14.sh new file mode 100755 index 0000000..5ed334c --- /dev/null +++ b/test/common-utils/alpine-3-14.sh @@ -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
\ No newline at end of file diff --git a/test/common-utils/alpine-3-15.sh b/test/common-utils/alpine-3-15.sh new file mode 100755 index 0000000..5ed334c --- /dev/null +++ b/test/common-utils/alpine-3-15.sh @@ -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
\ No newline at end of file diff --git a/test/common-utils/scenarios.json b/test/common-utils/scenarios.json index dbf9cdc..43d11c9 100644 --- a/test/common-utils/scenarios.json +++ b/test/common-utils/scenarios.json @@ -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": { "build": { "dockerfile": "Dockerfile" |