diff --git a/src/universal/.devcontainer/devcontainer-lock.json b/src/universal/.devcontainer/devcontainer-lock.json index 561a95065..1a0c0b4a3 100644 --- a/src/universal/.devcontainer/devcontainer-lock.json +++ b/src/universal/.devcontainer/devcontainer-lock.json @@ -15,10 +15,10 @@ "resolved": "ghcr.io/devcontainers/features/docker-in-docker@sha256:f6a73ee06601d703db7d95d03e415cab229e78df92bb5002e8559bcfc047fec6", "integrity": "sha256:f6a73ee06601d703db7d95d03e415cab229e78df92bb5002e8559bcfc047fec6" }, - "ghcr.io/devcontainers/features/dotnet:1": { - "version": "1.1.4", - "resolved": "ghcr.io/devcontainers/features/dotnet@sha256:0961cacbf160e67472c610b8a2836151854eca8657f14ee5fde604285829c2e4", - "integrity": "sha256:0961cacbf160e67472c610b8a2836151854eca8657f14ee5fde604285829c2e4" + "ghcr.io/devcontainers/features/dotnet:2": { + "version": "2.0.1", + "resolved": "ghcr.io/devcontainers/features/dotnet@sha256:0bddaf888065650a56abdca16d1c2669aeb0259cf6bbe0879d12cd7e11164fe8", + "integrity": "sha256:0bddaf888065650a56abdca16d1c2669aeb0259cf6bbe0879d12cd7e11164fe8" }, "ghcr.io/devcontainers/features/git-lfs:1": { "version": "1.1.1", @@ -61,9 +61,9 @@ "integrity": "sha256:7d31b83459dd5110c37e7f5acb2920335cb1e5ebf014326d7eb6a0b290cc820a" }, "ghcr.io/devcontainers/features/oryx:1": { - "version": "1.1.0", - "resolved": "ghcr.io/devcontainers/features/oryx@sha256:c83715c52f96077e3ba3a0ef986b76c6faba5bbc5d08935627bc61a579613176", - "integrity": "sha256:c83715c52f96077e3ba3a0ef986b76c6faba5bbc5d08935627bc61a579613176" + "version": "1.2.0", + "resolved": "ghcr.io/devcontainers/features/oryx@sha256:6e7ea6baf731ceae44c946567cb2f7497da22b82ef89384a49f5639d17f765f5", + "integrity": "sha256:6e7ea6baf731ceae44c946567cb2f7497da22b82ef89384a49f5639d17f765f5" }, "ghcr.io/devcontainers/features/php:1": { "version": "1.1.2", diff --git a/src/universal/.devcontainer/devcontainer.json b/src/universal/.devcontainer/devcontainer.json index 509211f2f..fbef0da08 100644 --- a/src/universal/.devcontainer/devcontainer.json +++ b/src/universal/.devcontainer/devcontainer.json @@ -9,10 +9,10 @@ "userUid": "1000", "userGid": "1000" }, - "ghcr.io/devcontainers/features/dotnet:1": { - "version": "7.0.306", - "installUsingApt": "false", - "additionalVersions": "6" + "ghcr.io/devcontainers/features/dotnet:2": { + "version": "8.0", + "dotnetRuntimeVersions": "7.0", + "aspNetCoreRuntimeVersions": "7.0" }, "ghcr.io/devcontainers/features/hugo:1": { "version": "latest" diff --git a/src/universal/.devcontainer/local-features/setup-user/install.sh b/src/universal/.devcontainer/local-features/setup-user/install.sh index 0dc3ad6ac..01b8c1e34 100644 --- a/src/universal/.devcontainer/local-features/setup-user/install.sh +++ b/src/universal/.devcontainer/local-features/setup-user/install.sh @@ -59,11 +59,17 @@ mkdir -p /home/${USERNAME}/.ruby ln -snf /usr/local/rvm/rubies/default $RUBY_PATH DOTNET_PATH="/home/${USERNAME}/.dotnet" -ln -snf /usr/local/dotnet/current $DOTNET_PATH + +# Required due to https://github.com/devcontainers/features/pull/628/files#r1276659825 +chown -R "${USERNAME}:${USERNAME}" /usr/share/dotnet +chmod g+r+w+s /usr/share/dotnet +chmod -R g+r+w /usr/share/dotnet + +ln -snf /usr/share/dotnet $DOTNET_PATH mkdir -p /opt/dotnet/lts -cp -R /usr/local/dotnet/current/dotnet /opt/dotnet/lts -cp -R /usr/local/dotnet/current/LICENSE.txt /opt/dotnet/lts -cp -R /usr/local/dotnet/current/ThirdPartyNotices.txt /opt/dotnet/lts +cp -R /usr/share/dotnet/dotnet /opt/dotnet/lts +cp -R /usr/share/dotnet/LICENSE.txt /opt/dotnet/lts +cp -R /usr/share/dotnet/ThirdPartyNotices.txt /opt/dotnet/lts MAVEN_PATH="/home/${USERNAME}/.maven/current" mkdir -p /home/${USERNAME}/.maven diff --git a/src/universal/test-project/test.sh b/src/universal/test-project/test.sh index 69356eef5..f8666c677 100644 --- a/src/universal/test-project/test.sh +++ b/src/universal/test-project/test.sh @@ -19,10 +19,9 @@ check "usr-local-etc-config-does-not-exist" test ! -f "/usr/local/etc/gitconfig" # Check .NET check "dotnet" dotnet --list-sdks -count=$(ls /usr/local/dotnet | wc -l) -expectedCount=3 # 2 version folders + 1 current folder which links to either one of the version -checkVersionCount "two versions of dotnet are present" $count $expectedCount -echo $(echo "list of installed dotnet versions" && ls -a /usr/local/dotnet) +check "dotnet-runtimes" bash -c "dotnet --list-runtimes" +# Runtimes are listed twice due to 'Microsoft.NETCore.App' and 'Microsoft.AspNetCore.App' +checkVersionCount "two versions of dotnet runtimes are present" $(dotnet --list-runtimes | wc -l) 4 # Check Python check "python" python --version @@ -150,7 +149,7 @@ check "nvm-works-in-node-project" bash -c "node --version | grep v8.0.0" check "default-node-location-remained-same" bash -c "which node | grep /home/codespace/nvm/current/bin" # Ensures sdkman works in a Java Project -check "default-java-version" bash -c "java --version | grep 17." +check "default-java-version" bash -c "java --version" check "default-java-location" bash -c "which java | grep /home/codespace/java/current/bin" check "oryx-build-java-project" bash -c "oryx build ./sample/java" check "oryx-configured-current-java-version" bash -c "ls -la /home/codespace/java/current | grep /opt/java"