diff --git a/src/vcpkg.io/install.sh b/src/vcpkg.io/install.sh index 8c26f70..e667306 100755 --- a/src/vcpkg.io/install.sh +++ b/src/vcpkg.io/install.sh @@ -32,6 +32,13 @@ install() { git clone https://github.com/microsoft/vcpkg "$vcpkgRoot" "$vcpkgRoot/bootstrap-vcpkg.sh" -disableMetrics ln -s "$vcpkgRoot/vcpkg" /usr/local/bin/vcpkg + + if [ ${_REMOTE_USER} != "root" ]; then + groupadd vcpkg + chown -R root:vcpkg $vcpkgRoot + chmod g+w $vcpkgRoot + usermod -aG vcpkg ${_REMOTE_USER} + fi } echo_banner "devcontainer.community" echo "Installing $name..." diff --git a/test/vcpkg.io/install_with_remote_user.sh b/test/vcpkg.io/install_with_remote_user.sh new file mode 100644 index 0000000..bbfc10a --- /dev/null +++ b/test/vcpkg.io/install_with_remote_user.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +source dev-container-features-test-lib + +check "install simple package with remote user" bash -c "vcpkg install vcpkg-cmake" + +reportResults diff --git a/test/vcpkg.io/scenarios.json b/test/vcpkg.io/scenarios.json new file mode 100644 index 0000000..07a12c7 --- /dev/null +++ b/test/vcpkg.io/scenarios.json @@ -0,0 +1,9 @@ +{ + "install_with_remote_user": { + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", + "remoteUser": "vscode", + "features": { + "vcpkg.io": {} + } + } +} \ No newline at end of file