-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #460 from akunzai/dev-containers
Simplify the mono msbuild installation in Dev container
- Loading branch information
Showing
6 changed files
with
113 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,20 @@ | ||
# https://hub.docker.com/_/microsoft-dotnet-sdk/ | ||
FROM mcr.microsoft.com/dotnet/sdk:8.0 | ||
|
||
ARG APT_URL="" | ||
|
||
# install ASP.NET Core 6.0 Runtime | ||
COPY --from=mcr.microsoft.com/dotnet/aspnet:6.0-bookworm-slim /usr/share/dotnet /usr/share/dotnet | ||
|
||
RUN set -eux; \ | ||
# preferred mirror site | ||
[ -n "$APT_URL" ] && [ "$APT_URL" = 'http://free.nchc.org.tw' ] && [ $(uname -m) = 'x86_64' ] && [ -e "/etc/apt/sources.list.d/debian.sources" ] && sed -i -E "/-security/! s,URIs: http?://[^\/]+,URIs: $APT_URL,g" /etc/apt/sources.list.d/debian.sources; \ | ||
[ -n "$APT_URL" ] && [ "$APT_URL" != 'http://free.nchc.org.tw' ] && [ -e "/etc/apt/sources.list.d/debian.sources" ] && sed -i -E "s,URIs: http?://[^\/]+,URIs: $APT_URL,g" /etc/apt/sources.list.d/debian.sources; \ | ||
# install msbuild for Mono | ||
# https://www.mono-project.com/download/stable/#download-lin-debian | ||
apt-get update; \ | ||
apt-get install -y --no-install-recommends dirmngr gnupg ca-certificates; \ | ||
# avoid connection timeout | ||
timeout 10 apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF || apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF; \ | ||
echo "deb http://download.mono-project.com/repo/debian stable-buster main" > /etc/apt/sources.list.d/mono-official-stable.list; \ | ||
apt-get update; \ | ||
apt-get install -y mono-devel; \ | ||
# clean up | ||
apt-get purge -y --auto-remove gnupg dirmngr; \ | ||
rm -rf /var/lib/apt/lists/* /tmp/*; \ | ||
# smoke test | ||
dotnet --info && msbuild -version; | ||
# install msbuild for Mono | ||
# https://hub.docker.com/_/mono/ | ||
COPY --from=mono /etc/ca-certificates/update.d/mono-keystore /etc/ca-certificates/update.d/ | ||
COPY --from=mono /etc/mono /etc/mono | ||
COPY --from=mono /usr/bin/cert-sync /usr/bin/ | ||
COPY --from=mono /usr/bin/mono /usr/bin/ | ||
COPY --from=mono /usr/bin/msbuild /usr/bin/ | ||
COPY --from=mono /usr/lib/mono /usr/lib/mono | ||
COPY --from=mono /usr/lib/libmono-* /usr/lib/ | ||
COPY --from=mono /usr/lib/libMono* /usr/lib/ | ||
|
||
# synchronizes the Mono TLS certificates | ||
# https://www.mono-project.com/docs/about-mono/releases/3.12.0/#cert-sync | ||
RUN cert-sync /etc/ssl/certs/ca-certificates.crt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
// https://github.com/dotnet/vscode-csharp/blob/main/debugger-launchjson.md。 | ||
"name": ".NET Core Launch (web)", | ||
"type": "coreclr", | ||
"request": "launch", | ||
"preLaunchTask": "build", | ||
// Needs change path when updating target Framework | ||
"program": "${workspaceFolder}/samples/AspNetCoreSample/bin/Debug/net8.0/AspNetCoreSample.dll", | ||
"args": [], | ||
"cwd": "${workspaceFolder}/samples/AspNetCoreSample", | ||
"stopAtEntry": false, | ||
// https://aka.ms/VSCode-CS-LaunchJson-WebBrowser | ||
"serverReadyAction": { | ||
"action": "openExternally", | ||
"pattern": "\\bNow listening on:\\s+(https?://\\S+)" | ||
}, | ||
"env": { | ||
"ASPNETCORE_ENVIRONMENT": "Development" | ||
}, | ||
"sourceFileMap": { | ||
"/Views": "${workspaceFolder}/Views" | ||
} | ||
}, | ||
{ | ||
"name": ".NET Core Attach", | ||
"type": "coreclr", | ||
"request": "attach" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "build", | ||
"command": "dotnet", | ||
"type": "process", | ||
"args": [ | ||
"build", | ||
"${workspaceFolder}/CAS.sln", | ||
"/property:GenerateFullPaths=true", | ||
"/consoleloggerparameters:NoSummary;ForceNoAlign" | ||
], | ||
"problemMatcher": "$msCompile" | ||
}, | ||
{ | ||
"label": "publish", | ||
"command": "dotnet", | ||
"type": "process", | ||
"args": [ | ||
"publish", | ||
"${workspaceFolder}/CAS.sln", | ||
"/property:GenerateFullPaths=true", | ||
"/consoleloggerparameters:NoSummary;ForceNoAlign" | ||
], | ||
"problemMatcher": "$msCompile" | ||
}, | ||
{ | ||
"label": "watch", | ||
"command": "dotnet", | ||
"type": "process", | ||
"args": ["watch", "run", "--project", "${workspaceFolder}/CAS.sln"], | ||
"problemMatcher": "$msCompile" | ||
} | ||
] | ||
} |