Skip to content

Commit afbdf7c

Browse files
authored
[universal] - Update Oryx feature with DEBIAN_FLAVOR bookworm (#1809)
1 parent d024e0f commit afbdf7c

6 files changed

Lines changed: 32 additions & 29 deletions

File tree

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
"integrity": "sha256:ce078b7bf7d9ef3bcb9813b32103795d8d72172446890b64772cbe1dec6baafd"
2222
},
2323
"ghcr.io/devcontainers/features/dotnet:2": {
24-
"version": "2.4.2",
25-
"resolved": "ghcr.io/devcontainers/features/dotnet@sha256:e56b2abde945918508f1bca94d5545e23b30f5f1d4f3b363ad4819c6b81396f1",
26-
"integrity": "sha256:e56b2abde945918508f1bca94d5545e23b30f5f1d4f3b363ad4819c6b81396f1"
24+
"version": "2.5.0",
25+
"resolved": "ghcr.io/devcontainers/features/dotnet@sha256:0fc16547ed4db6d7ff2a9f5981d2b93eb314e568affb9958029ad794f1f9a093",
26+
"integrity": "sha256:0fc16547ed4db6d7ff2a9f5981d2b93eb314e568affb9958029ad794f1f9a093"
2727
},
2828
"ghcr.io/devcontainers/features/git-lfs:1": {
2929
"version": "1.2.5",
@@ -65,10 +65,10 @@
6565
"resolved": "ghcr.io/devcontainers/features/node@sha256:8c0de46939b61958041700ee89e3493f3b2e4131a06dc46b4d9423427d06e5f6",
6666
"integrity": "sha256:8c0de46939b61958041700ee89e3493f3b2e4131a06dc46b4d9423427d06e5f6"
6767
},
68-
"ghcr.io/devcontainers/features/oryx:1": {
69-
"version": "1.4.1",
70-
"resolved": "ghcr.io/devcontainers/features/oryx@sha256:afffd5b839bb25e29f8abbe5c7be913ae8793a2af684af7ed89a75c22a70a471",
71-
"integrity": "sha256:afffd5b839bb25e29f8abbe5c7be913ae8793a2af684af7ed89a75c22a70a471"
68+
"ghcr.io/devcontainers/features/oryx:2": {
69+
"version": "2.0.0",
70+
"resolved": "ghcr.io/devcontainers/features/oryx@sha256:5295f2aa261376a83c29f3cfd6f6d967bb352d1ff7b54436f2029fd48c692b67",
71+
"integrity": "sha256:5295f2aa261376a83c29f3cfd6f6d967bb352d1ff7b54436f2029fd48c692b67"
7272
},
7373
"ghcr.io/devcontainers/features/php:1": {
7474
"version": "1.1.4",

src/universal/.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
"version": "latest"
7474
},
7575
"./local-features/jekyll": "latest",
76-
"ghcr.io/devcontainers/features/oryx:1": "latest",
76+
"ghcr.io/devcontainers/features/oryx:2": "latest",
7777
"./local-features/setup-user": "latest",
7878
"./local-features/patch-conda": {},
7979
"./local-features/patch-python": {}

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ sudo_if() {
3030
}
3131

3232
# Enables the oryx tool to generate manifest-dir which is needed for running the postcreate tool
33-
DEBIAN_FLAVOR="focal-scm"
34-
mkdir -p /opt/oryx && echo "vso-focal" > /opt/oryx/.imagetype
33+
DEBIAN_FLAVOR="bookworm"
34+
mkdir -p /opt/oryx && echo "vso-bookworm" > /opt/oryx/.imagetype
3535
echo "DEBIAN|${DEBIAN_FLAVOR}" | tr '[a-z]' '[A-Z]' > /opt/oryx/.ostype
3636

3737
# Oryx expects the tool to be installed at `/opt/oryx` and looks for relevant files in there.
@@ -89,6 +89,15 @@ chown -R ${USERNAME}:oryx ${OPT_DOTNET_DIR}
8989
chmod -R g+r+w "${OPT_DOTNET_DIR}"
9090
find "${OPT_DOTNET_DIR}" -type d | xargs -n 1 chmod g+s
9191

92+
# Patch createSymlinksForDotnet.sh to handle the case where the symlink destination
93+
# already exists as a real directory (e.g. /home/codespace/.dotnet -> /usr/share/dotnet
94+
# which already has packs/NETStandard.Library.Ref/2.1.0 from a pre-installed .NET SDK).
95+
# Without this, `ln -sTf` fails because it cannot overwrite a real directory.
96+
if [ -f "/opt/tmp/build/createSymlinksForDotnet.sh" ]; then
97+
sed -i '/echo "\$linkTo is missing, creating \.\.\."/a\ if [ -d "$linkFrom" ] \&\& [ ! -L "$linkFrom" ]; then rm -rf "$linkFrom"; fi' \
98+
/opt/tmp/build/createSymlinksForDotnet.sh
99+
fi
100+
92101
echo "Defaults secure_path=\"${DOTNET_PATH}:${NODE_PATH}/bin:${PHP_PATH}/bin:${PYTHON_PATH}/bin:${JAVA_PATH}/bin:${RUBY_PATH}/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/bin:/usr/local/share:/home/${USERNAME}/.local/bin:${PATH}\"" >> /etc/sudoers.d/$USERNAME
93102

94103
echo "Done!"

src/universal/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ The container includes the `zsh` (and Oh My Zsh!) and `fish` shells that you can
2727
You can decide how often you want updates by referencing a [semantic version](https://semver.org/) of each image.
2828
For example:
2929

30-
- `mcr.microsoft.com/devcontainers/universal:5-noble`
31-
- `mcr.microsoft.com/devcontainers/universal:5.1-noble`
32-
- `mcr.microsoft.com/devcontainers/universal:5.1.5-noble`
30+
- `mcr.microsoft.com/devcontainers/universal:6-noble`
31+
- `mcr.microsoft.com/devcontainers/universal:6.0-noble`
32+
- `mcr.microsoft.com/devcontainers/universal:6.0.0-noble`
3333

3434
See [history](history) for information on the contents of each version and [here for a complete list of available tags](https://mcr.microsoft.com/v2/devcontainers/universal/tags/list).
3535

src/universal/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "5.1.5",
2+
"version": "6.0.0",
33
"build": {
44
"latest": true,
55
"rootDistro": "debian",

src/universal/test-project/test.sh

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,6 @@ check "default-node-location-remained-same" bash -c "which node | grep /home/cod
143143
# Ensures sdkman works in a Java Project
144144
check "default-java-version" bash -c "java --version"
145145
check "default-java-location" bash -c "which java | grep /home/codespace/java/current/bin"
146-
check "oryx-build-java-project" bash -c "oryx build ./sample/java"
147-
check "oryx-configured-current-java-version" bash -c "ls -la /home/codespace/java/current | grep /opt/java"
148146
check "sdk-install-java" bash -c ". /usr/local/sdkman/bin/sdkman-init.sh && sdk install java 19.0.1-oracle < /dev/null"
149147
check "sdkman-works-in-java-project" bash -c "java --version | grep 19.0.1"
150148
check "default-java-location-remained-same" bash -c "which java | grep /home/codespace/java/current/bin"
@@ -157,21 +155,17 @@ check "oryx-build-python-installed" python3 -m pip list | grep mpmath
157155
check "oryx-build-python-result" python3 ./sample/python/src/solve.py
158156

159157
# Install platforms with oryx build tool
160-
check "oryx-install-dotnet-2.1" oryx prep --skip-detection --platforms-and-versions dotnet=2.1.30
161-
check "dotnet-2-installed-by-oryx" ls /opt/dotnet/ | grep 2.1
162-
check "dotnet-version-on-path-is-2.1.12" dotnet --version | grep 2.1
158+
check "oryx-install-dotnet-8.0" oryx prep --skip-detection --platforms-and-versions dotnet=8.0.23
159+
check "dotnet-8-installed-by-oryx" ls /opt/dotnet/ | grep 8.0
160+
check "dotnet-version-on-path-is-8.0.23" dotnet --version | grep 8.0
163161

164-
check "oryx-install-nodejs-12.22.11" oryx prep --skip-detection --platforms-and-versions nodejs=12.22.11
165-
check "nodejs-12.22.11-installed-by-oryx" ls /opt/nodejs/ | grep 12.22.11
166-
check "nodejs-version-on-path-is-2.1.12" node --version | grep v12.22.11
162+
check "oryx-install-nodejs-20.11.0" oryx prep --skip-detection --platforms-and-versions nodejs=20.11.0
163+
check "nodejs-20.11.0-installed-by-oryx" ls /opt/nodejs/ | grep 20.11.0
164+
check "nodejs-version-on-path-is-20.11.0" node --version | grep v20.11.0
167165

168-
check "oryx-install-php-7.3.25" oryx prep --skip-detection --platforms-and-versions php=7.3.25
169-
check "php-7.3.25-installed-by-oryx" ls /opt/php/ | grep 7.3.25
170-
check "php-version-on-path-is-2.1.12" php --version | grep 7.3.25
171-
172-
check "oryx-install-java-12.0.2" oryx prep --skip-detection --platforms-and-versions java=12.0.2
173-
check "java-12.0.2-installed-by-oryx" ls /opt/java/ | grep 12.0.2
174-
check "java-version-on-path-is-12.0.2" java --version | grep 12.0.2
166+
check "oryx-install-php-8.1.30" oryx prep --skip-detection --platforms-and-versions php=8.1.30
167+
check "php-8.1.30-installed-by-oryx" ls /opt/php/ | grep 8.1.30
168+
check "php-version-on-path-is-8.1.30" php --version | grep 8.1.30
175169

176170
# Test patches
177171

0 commit comments

Comments
 (0)