#docker build -f .\Dockerfile.txt -t jscat/dotnet10-framework-sonar-scanner:env .
# 使用包含 MSBuild 的 SDK 映像檔
FROM mcr.microsoft.com/dotnet/sdk:10.0-windowsservercore-ltsc2022
# 安裝 Java (SonarScanner 運作必要)
RUN powershell -Command \
$url = 'https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.9%2B10/OpenJDK21U-jre_x64_windows_hotspot_21.0.9_10.zip'; \
Invoke-WebRequest -Uri $url -OutFile jre.zip; \
Expand-Archive jre.zip -DestinationPath C:\java; \
Remove-Item jre.zip
# 將路徑加入環境變數
RUN setx /M JAVA_HOME "C:\java\jdk-21.0.9+10-jre"
# 將 Java 和 SonarScanner 加入 PATH
RUN setx /M PATH "%PATH%;C:\sonar-scanner;%JAVA_HOME%\bin"
ENTRYPOINT ["powershell.exe", "-NoLogo", "-ExecutionPolicy", "Bypass"]
No tags have been pushed to this repository yet.