Skip to content

Commit 897f0a3

Browse files
seesharprunsamruddhikhandaleeljog
authored
Update universal image to .NET 8 (#855)
* Update .NET feature to version 2 * Removed .NET 7 * Update src/universal/.devcontainer/devcontainer.json Co-authored-by: Samruddhi Khandale <[email protected]> * Updated to add .NET 7 back * Switch back to version 1 of .NET feature * Flip .NET versions to make .NET 8 primary * Switch feature version back to 2 * Be more specific with .NET 7 * Change .NET `8.0` to .NET `8.0.x` * Add .NET 6 and 7 runtimes * Switch to only .NET 8 and .NET 7 * Change .NET install directory per @samruddhikhandale suggestion * Updated devcontainer-lock.json file * Update install.sh - fix tests * Update test.sh - Fix tests --------- Co-authored-by: Samruddhi Khandale <[email protected]> Co-authored-by: Eljo George <[email protected]> Co-authored-by: Samruddhi Khandale <[email protected]>
1 parent f3cfc7e commit 897f0a3

File tree

4 files changed

+25
-20
lines changed

4 files changed

+25
-20
lines changed

src/universal/.devcontainer/devcontainer-lock.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
"resolved": "ghcr.io/devcontainers/features/docker-in-docker@sha256:f6a73ee06601d703db7d95d03e415cab229e78df92bb5002e8559bcfc047fec6",
1616
"integrity": "sha256:f6a73ee06601d703db7d95d03e415cab229e78df92bb5002e8559bcfc047fec6"
1717
},
18-
"ghcr.io/devcontainers/features/dotnet:1": {
19-
"version": "1.1.4",
20-
"resolved": "ghcr.io/devcontainers/features/dotnet@sha256:0961cacbf160e67472c610b8a2836151854eca8657f14ee5fde604285829c2e4",
21-
"integrity": "sha256:0961cacbf160e67472c610b8a2836151854eca8657f14ee5fde604285829c2e4"
18+
"ghcr.io/devcontainers/features/dotnet:2": {
19+
"version": "2.0.1",
20+
"resolved": "ghcr.io/devcontainers/features/dotnet@sha256:0bddaf888065650a56abdca16d1c2669aeb0259cf6bbe0879d12cd7e11164fe8",
21+
"integrity": "sha256:0bddaf888065650a56abdca16d1c2669aeb0259cf6bbe0879d12cd7e11164fe8"
2222
},
2323
"ghcr.io/devcontainers/features/git-lfs:1": {
2424
"version": "1.1.1",
@@ -61,9 +61,9 @@
6161
"integrity": "sha256:7d31b83459dd5110c37e7f5acb2920335cb1e5ebf014326d7eb6a0b290cc820a"
6262
},
6363
"ghcr.io/devcontainers/features/oryx:1": {
64-
"version": "1.1.0",
65-
"resolved": "ghcr.io/devcontainers/features/oryx@sha256:c83715c52f96077e3ba3a0ef986b76c6faba5bbc5d08935627bc61a579613176",
66-
"integrity": "sha256:c83715c52f96077e3ba3a0ef986b76c6faba5bbc5d08935627bc61a579613176"
64+
"version": "1.2.0",
65+
"resolved": "ghcr.io/devcontainers/features/oryx@sha256:6e7ea6baf731ceae44c946567cb2f7497da22b82ef89384a49f5639d17f765f5",
66+
"integrity": "sha256:6e7ea6baf731ceae44c946567cb2f7497da22b82ef89384a49f5639d17f765f5"
6767
},
6868
"ghcr.io/devcontainers/features/php:1": {
6969
"version": "1.1.2",

src/universal/.devcontainer/devcontainer.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
"userUid": "1000",
1010
"userGid": "1000"
1111
},
12-
"ghcr.io/devcontainers/features/dotnet:1": {
13-
"version": "7.0.306",
14-
"installUsingApt": "false",
15-
"additionalVersions": "6"
12+
"ghcr.io/devcontainers/features/dotnet:2": {
13+
"version": "8.0",
14+
"dotnetRuntimeVersions": "7.0",
15+
"aspNetCoreRuntimeVersions": "7.0"
1616
},
1717
"ghcr.io/devcontainers/features/hugo:1": {
1818
"version": "latest"

src/universal/.devcontainer/local-features/setup-user/install.sh

+10-4
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,17 @@ mkdir -p /home/${USERNAME}/.ruby
5959
ln -snf /usr/local/rvm/rubies/default $RUBY_PATH
6060

6161
DOTNET_PATH="/home/${USERNAME}/.dotnet"
62-
ln -snf /usr/local/dotnet/current $DOTNET_PATH
62+
63+
# Required due to https://github.com/devcontainers/features/pull/628/files#r1276659825
64+
chown -R "${USERNAME}:${USERNAME}" /usr/share/dotnet
65+
chmod g+r+w+s /usr/share/dotnet
66+
chmod -R g+r+w /usr/share/dotnet
67+
68+
ln -snf /usr/share/dotnet $DOTNET_PATH
6369
mkdir -p /opt/dotnet/lts
64-
cp -R /usr/local/dotnet/current/dotnet /opt/dotnet/lts
65-
cp -R /usr/local/dotnet/current/LICENSE.txt /opt/dotnet/lts
66-
cp -R /usr/local/dotnet/current/ThirdPartyNotices.txt /opt/dotnet/lts
70+
cp -R /usr/share/dotnet/dotnet /opt/dotnet/lts
71+
cp -R /usr/share/dotnet/LICENSE.txt /opt/dotnet/lts
72+
cp -R /usr/share/dotnet/ThirdPartyNotices.txt /opt/dotnet/lts
6773

6874
MAVEN_PATH="/home/${USERNAME}/.maven/current"
6975
mkdir -p /home/${USERNAME}/.maven

src/universal/test-project/test.sh

+4-5
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,9 @@ check "usr-local-etc-config-does-not-exist" test ! -f "/usr/local/etc/gitconfig"
1919

2020
# Check .NET
2121
check "dotnet" dotnet --list-sdks
22-
count=$(ls /usr/local/dotnet | wc -l)
23-
expectedCount=3 # 2 version folders + 1 current folder which links to either one of the version
24-
checkVersionCount "two versions of dotnet are present" $count $expectedCount
25-
echo $(echo "list of installed dotnet versions" && ls -a /usr/local/dotnet)
22+
check "dotnet-runtimes" bash -c "dotnet --list-runtimes"
23+
# Runtimes are listed twice due to 'Microsoft.NETCore.App' and 'Microsoft.AspNetCore.App'
24+
checkVersionCount "two versions of dotnet runtimes are present" $(dotnet --list-runtimes | wc -l) 4
2625

2726
# Check Python
2827
check "python" python --version
@@ -150,7 +149,7 @@ check "nvm-works-in-node-project" bash -c "node --version | grep v8.0.0"
150149
check "default-node-location-remained-same" bash -c "which node | grep /home/codespace/nvm/current/bin"
151150

152151
# Ensures sdkman works in a Java Project
153-
check "default-java-version" bash -c "java --version | grep 17."
152+
check "default-java-version" bash -c "java --version"
154153
check "default-java-location" bash -c "which java | grep /home/codespace/java/current/bin"
155154
check "oryx-build-java-project" bash -c "oryx build ./sample/java"
156155
check "oryx-configured-current-java-version" bash -c "ls -la /home/codespace/java/current | grep /opt/java"

0 commit comments

Comments
 (0)