Skip to content

Commit 631e361

Browse files
authored
Merge pull request #409 from linuxserver/code-server-dotnet-s6v3
switch to hybrid (code-server-dotnet)
2 parents 5367cec + e7a6507 commit 631e361

File tree

6 files changed

+66
-0
lines changed

6 files changed

+66
-0
lines changed

root/etc/s6-overlay/s6-rc.d/init-mod-code-server-dotnet-add-package/dependencies.d/init-mods

Whitespace-only changes.
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
#!/usr/bin/with-contenv bash
2+
3+
# Determine if setup is needed
4+
if [ -d /dotnet ]; then
5+
# install deps
6+
echo "**** Adding dotnet dependencies to package install list ****"
7+
source /etc/lsb-release
8+
if [ "${DISTRIB_CODENAME}" == "focal" ]; then
9+
echo "libicu66" >> /mod-repo-packages-to-install.list
10+
elif [ "${DISTRIB_CODENAME}" == "jammy" ]; then
11+
echo "libicu70" >> /mod-repo-packages-to-install.list
12+
fi
13+
# remove existing install if updating
14+
if ls -d /dotnet_* >/dev/null 2>&1; then
15+
echo "deleting" $(ls -d /dotnet_*)
16+
rm -rf /dotnet_*
17+
fi
18+
DOTNET_VERSIONS=$(cat /dotnet/versions.txt)
19+
ARCH=$(uname -m)
20+
for i in $DOTNET_VERSIONS; do
21+
mkdir -p "/dotnet_${i}"
22+
tar xzf "/dotnet/dotnetsdk_${i}_${ARCH}.tar.gz" -C "/dotnet_${i}"
23+
done
24+
rm -rf /dotnet
25+
# symlink latest dotnet binary
26+
DOTNET_LATEST=$(echo "$DOTNET_VERSIONS" | awk '{print $1}')
27+
rm -rf /usr/local/bin/dotnet
28+
ln -s /dotnet_${DOTNET_LATEST}/dotnet /usr/local/bin/dotnet
29+
echo "
30+
****************************************************
31+
****************************************************
32+
**
33+
**
34+
DOTNET SDK versions installed:
35+
$(echo $DOTNET_VERSIONS | sed 's| |\n |g')
36+
**
37+
**
38+
Binary locations are:"
39+
for i in $DOTNET_VERSIONS; do
40+
echo " /dotnet_${i}/dotnet"
41+
done
42+
echo " **
43+
**
44+
Version $DOTNET_LATEST is symlinked from /usr/local/bin/dotnet and can be called from anywhere via \"dotnet\"
45+
**
46+
**
47+
****************************************************
48+
****************************************************"
49+
# symlink other dotnet installs for access through latest binary
50+
for i in {2..5}; do
51+
DOTNET_OTHER_SDK_VERSION="$(echo $DOTNET_VERSIONS | awk -v var=${i} '{print $var}')"
52+
if [ -n "$DOTNET_OTHER_SDK_VERSION" ]; then
53+
DOTNET_OTHER_RUNTIME_VERSION="$(ls /dotnet_${DOTNET_OTHER_SDK_VERSION}/shared/Microsoft.NETCore.App)"
54+
echo "**** Symlinking sdk version ${DOTNET_OTHER_SDK_VERSION} and runtime version ${DOTNET_OTHER_RUNTIME_VERSION} ****"
55+
ln -s "/dotnet_${DOTNET_OTHER_SDK_VERSION}/shared/Microsoft.NETCore.App/${DOTNET_OTHER_RUNTIME_VERSION}" "/dotnet_${DOTNET_LATEST}/shared/Microsoft.NETCore.App/${DOTNET_OTHER_RUNTIME_VERSION}"
56+
ln -s "/dotnet_${DOTNET_OTHER_SDK_VERSION}/shared/Microsoft.AspNetCore.App/${DOTNET_OTHER_RUNTIME_VERSION}" "/dotnet_${DOTNET_LATEST}/shared/Microsoft.AspNetCore.App/${DOTNET_OTHER_RUNTIME_VERSION}"
57+
ln -s "/dotnet_${DOTNET_OTHER_SDK_VERSION}/sdk/${DOTNET_OTHER_SDK_VERSION}" "/dotnet_${DOTNET_LATEST}/sdk/${DOTNET_OTHER_SDK_VERSION}"
58+
else
59+
break
60+
fi
61+
done
62+
else
63+
echo "**** Existing dotnet install is up to date, skipping ****"
64+
fi
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
oneshot
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/etc/s6-overlay/s6-rc.d/init-mod-code-server-dotnet-add-package/run

root/etc/s6-overlay/s6-rc.d/init-mods-package-install/dependencies.d/init-mod-code-server-dotnet-add-package

Whitespace-only changes.

root/etc/s6-overlay/s6-rc.d/user/contents.d/init-mod-code-server-dotnet-add-package

Whitespace-only changes.

0 commit comments

Comments
 (0)