# Stage 1: Build FROM mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2019 AS build WORKDIR /src # Copy the full repository into the container COPY . . # Download NuGet CLI and restore packages RUN powershell -Command "Invoke-WebRequest -UseBasicParsing -OutFile nuget.exe https://www.nuget.org/nuget.exe" RUN nuget restore shadowsocks-windows.sln -NonInteractive # Build the solution in Release mode for x86 RUN msbuild shadowsocks-windows.sln /p:Configuration=Release /p:Platform=x86 # Stage 2: Runtime image FROM mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019 AS runtime WORKDIR /app # Copy built binaries from the build stage COPY --from=build /src/shadowsocks-csharp/bin/x86/Release/ /app/ # Default to running Shadowsocks.exe (GUI app) CMD ["Shadowsocks.exe"]
# Stage 1: Build FROM mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2019 AS build WORKDIR /src # Copy the full repository into the container COPY . . # Restore NuGet packages and build RUN powershell -Command "Set-ExecutionPolicy Bypass -Scope Process; nuget restore shadowsocks-windows.sln -NonInteractive" RUN msbuild shadowsocks-windows.sln /p:Configuration=Release /p:Platform=x86 /m # Stage 2: Runtime image FROM mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019 AS runtime WORKDIR /app # Copy built binaries from the build stage COPY --from=build /src/shadowsocks-csharp/bin/x86/Release/ /app/ # Default command to run the GUI application CMD ["Shadowsocks.exe"]
# Stage 1: Build FROM mcr.microsoft.com/dotnet/framework/sdk:4.8 AS build WORKDIR /src # Copy the full repository into the container COPY . . # Restore NuGet packages and build RUN powershell -Command "Set-ExecutionPolicy Bypass -Scope Process; nuget restore shadowsocks-windows.sln -NonInteractive" RUN msbuild shadowsocks-windows.sln /p:Configuration=Release /p:Platform=x86 /m # Stage 2: Runtime image FROM mcr.microsoft.com/dotnet/framework/runtime:4.8 AS runtime WORKDIR /app # Copy built binaries from the build stage COPY --from=build /src/shadowsocks-csharp/bin/x86/Release/ /app/ # Default command to run the GUI application CMD ["Shadowsocks.exe"]
# Build stage using Windows Server Core with VS Build Tools (for .NET Framework projects)
FROM mcr.microsoft.com/windows/servercore:ltsc2019 AS build
WORKDIR /src
# Copy source code
COPY . .
# Install Chocolatey and VS Build Tools, NuGet for restoring packages
RUN powershell -NoProfile -ExecutionPolicy Bypass -Command \
"Set-ExecutionPolicy Bypass -Scope Process; " \
+ "$i = New-Object System.Net.WebClient; " \
+ "$i.Headers[\"User-Agent\"] = \"DockerBuildAgent\"; " \
+ "iwr https://chocolatey.org/install.ps1 -UseBasicParsing | iex; " \
+ "choco install nuget.commandline -y --no-progress; " \
+ "choco install visualstudio2019buildtools -y --no-progress"
# Restore and build (x86) in Release mode
RUN nuget restore shadowsocks-windows.sln -NonInteractive
RUN msbuild Shadowsocks-windows.sln /p:Configuration=Release /p:Platform=x86 /m
# Runtime stage
FROM mcr.microsoft.com/windows/servercore:ltsc2019 AS runtime
WORKDIR /app
# Copy built binaries from the build stage
COPY --from=build /src/shadowsocks-csharp/bin/x86/Release/ /app/
# Default command to run the GUI application
CMD ["Shadowsocks.exe"]
# Stage 1: Build the project in a Windows .NET Framework SDK image FROM mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2019 AS build WORKDIR /src # Copy the entire repository into the build context COPY . . # Restore NuGet packages and build for x86 in Release mode RUN nuget restore shadowsocks-windows.sln -NonInteractive RUN msbuild shadowsocks-windows.sln /p:Configuration=Release /p:Platform=x86 /m # Stage 2: Runtime image FROM mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019 AS runtime WORKDIR /app # Copy the built binaries from the build stage COPY --from=build /src/shadowsocks-csharp/bin/x86/Release/ /app/ # Default command to run the GUI Shadowsocks application CMD ["Shadowsocks.exe"]
# Stage 1: Build using Windows .NET Framework SDK image FROM microsoft/dotnet-framework/sdk:4.8-windowsservercore-ltsc2019 AS build WORKDIR /src # Copy the full repository COPY . . # Restore NuGet packages and build the solution for x86 Release RUN nuget restore shadowsocks-windows.sln -NonInteractive RUN msbuild shadowsocks-windows.sln /p:Configuration=Release /p:Platform=x86 /m # Stage 2: Runtime image FROM microsoft/dotnet-framework/runtime:4.8-windowsservercore-ltsc2019 AS runtime WORKDIR /app # Copy built binaries from the build stage COPY --from=build /src/shadowsocks-csharp/bin/x86/Release/ /app/ # Default command: run the GUI application CMD ["Shadowsocks.exe"]
# Stage 1: Build the project (Windows .NET Framework) using official .NET Framework SDK image FROM mcr.microsoft.com/dotnet/framework/sdk:4.8 AS build WORKDIR /src # Copy the repository into the container COPY . . # Restore NuGet packages and build the solution for x86 in Release mode RUN nuget restore shadowsocks-windows.sln -NonInteractive RUN msbuild shadowsocks-windows.sln /p:Configuration=Release /p:Platform=x86 /m # Stage 2: Runtime image FROM mcr.microsoft.com/dotnet/framework/runtime:4.8 AS runtime WORKDIR /app # Copy built binaries from the build stage COPY --from=build /src/shadowsocks-csharp/bin/x86/Release/ /app/ # Default command to run the GUI Shadowsocks application CMD ["Shadowsocks.exe"]
# Stage 1: Build the project (Windows .NET Framework) using official .NET Framework SDK image FROM mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2019 AS build WORKDIR /src # Copy the repository into the container COPY . . # Restore NuGet packages and build the solution for x86 in Release mode RUN nuget restore shadowsocks-windows.sln -NonInteractive RUN msbuild shadowsocks-windows.sln /p:Configuration=Release /p:Platform=x86 /m # Stage 2: Runtime image FROM mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019 AS runtime WORKDIR /app # Copy built binaries from the build stage COPY --from=build /src/shadowsocks-csharp/bin/x86/Release/ /app/ # Default command to run the GUI Shadowsocks application CMD ["Shadowsocks.exe"]
# Stage 1: Build with Windows .NET Framework SDK FROM microsoft/dotnet-framework-sdk:4.8-windowsservercore-ltsc2019 AS build WORKDIR /src COPY . . RUN nuget restore shadowsocks-windows.sln -NonInteractive RUN msbuild shadowsocks-windows.sln /p:Configuration=Release /p:Platform=x86 /m # Stage 2: Runtime image FROM microsoft/dotnet-framework-runtime:4.8-windowsservercore-ltsc2019 AS runtime WORKDIR /app COPY --from=build /src/shadowsocks-csharp/bin/x86/Release/ /app/ CMD ["Shadowsocks.exe"]
# Stage 1: Build the project using the .NET Framework SDK image FROM mcr.microsoft.com/dotnet/framework/sdk:4.8 AS build WORKDIR /src # Copy the repository into the container COPY . . # Restore NuGet packages and build (target x86 Release) RUN nuget restore shadowsocks-windows.sln -NonInteractive RUN msbuild shadowsocks-windows.sln /p:Configuration=Release /p:Platform=x86 /m # Stage 2: Runtime image FROM mcr.microsoft.com/dotnet/framework/runtime:4.8 AS runtime WORKDIR /app # Copy built binaries from the build stage COPY --from=build /src/shadowsocks-csharp/bin/x86/Release/ /app/ # Default command to run the GUI Shadowsocks application CMD ["Shadowsocks.exe"]
# Stage 1: Build using the .NET Framework SDK (Windows) FROM mcr.microsoft.com/dotnet/framework/sdk:4.8 AS build WORKDIR /src # Copy the repo COPY . . # Restore and build (targeting x86 Release) RUN nuget restore shadowsocks-windows.sln -NonInteractive RUN nv = nuget; RUN msbuild shadowsocks-windows.sln /p:Configuration=Release /p:Platform=x86 /m # Stage 2: Runtime image FROM mcr.microsoft.com/dotnet/framework/runtime:4.8 AS runtime WORKDIR /app # Copy the built binaries from build stage COPY --from=build /src/shadowsocks-csharp/bin/x86/Release/ /app/ # Run the GUI application by default CMD ["Shadowsocks.exe"]
# Stage 1: Build with .NET Framework SDK image FROM mcr.microsoft.com/dotnet/framework/sdk:4.8 AS build WORKDIR /src # Copy the repository COPY . . # Restore and build (target x86 Release) RUN nuget restore shadowsocks-windows.sln -NonInteractive RUN msbuild shadowsocks-windows.sln /p:Configuration=Release /p:Platform=x86 /m # Stage 2: Runtime image FROM mcr.microsoft.com/dotnet/framework/runtime:4.8 AS runtime WORKDIR /app # Copy the built binaries from the build stage COPY --from=build /src/shadowsocks-csharp/bin/x86/Release/ /app/ # Default command to run the GUI Shadowsocks application CMD ["Shadowsocks.exe"]
# Stage 1: Build the project using .NET Framework SDK image (Windows) FROM mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2019 AS build WORKDIR /src # Copy the repository COPY . . # Restore NuGet packages and build for x86 in Release mode RUN nuget restore shadowsocks-windows.sln -NonInteractive RUN msbuild shadowsocks-windows.sln /p:Configuration=Release /p:Platform=x86 /m # Stage 2: Runtime image FROM mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019 AS runtime WORKDIR /app # Copy built binaries from the build stage COPY --from=build /src/shadowsocks-csharp/bin/x86/Release/ /app/ # Default command to run the GUI application CMD ["Shadowsocks.exe"]
# Stage 1: Build the project (Windows .NET Framework) FROM mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2019 AS build WORKDIR /src # Copy the repository into the build context COPY . . # Restore NuGet packages and build for x86 Release RUN nuget restore shadowsocks-windows.sln -NonInteractive RUN msbuild shadowsocks-windows.sln /p:Configuration=Release /p:Platform=x86 /m # Stage 2: Runtime image FROM mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019 AS runtime WORKDIR /app # Copy built binaries from the build stage COPY --from=build /src/shadowsocks-csharp/bin/x86/Release/ /app/ # Default command to run the GUI Shadowsocks application CMD ["Shadowsocks.exe"]
FROM ubuntu:22.04
# Install basic tools
RUN apt-get update \
&& apt-get install -y ca-certificates curl unzip \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /src
# Copy source code (for reference; actual Windows build is not performed here)
COPY . .
# A placeholder build step (no-op for non-Windows environments)
RUN echo "Note: Building Windows .NET Framework project (shadowsocks-windows) requires Windows containers. This Linux-based Dockerfile serves as a placeholder to illustrate the build intent."
CMD ["bash"]
# Ignore VCS and common build artifacts .git .git/ # Ignore OS and editor files .DS_Store *.swp *.swo # Ignore .NET build outputs in case of cross-platform caching **/bin/ **/obj/ **/*.user **/*.cache **/*.pdb **/*.dll **/*.exe # Ignore npm and node modules if present **/node_modules/ # Ignore test and packaging outputs **/test/ **/test/** # Ignore AppVeyor / CI artifacts appveyor.yml open-api.json
Concerns: No actual build of the C# desktop app is performed; the Dockerfile contains only a placeholder echo statement about Windows .NET Framework needing Windows containers., This Linux-based image cannot build a Windows/.NET Framework project; the build intent is not realized, which defeats the purpose of building from source., COPY . . copies the entire build context, which may include files not needed for a Linux placeholder and could bloat the image; there is no subsequent build step to compile source.
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2019 AS build WORKDIR /src # Copy all repository files COPY . . # Restore and build for x86 Release RUN nuget restore shadowsocks-windows.sln -NonInteractive RUN msbuild shadowsocks-windows.sln /p:Configuration=Release /p:Platform=x86 -m FROM mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019 AS runtime WORKDIR /app # Copy built binaries from the build stage COPY --from=build /src/shadowsocks-csharp/bin/x86/Release/ /app/ CMD ["Shadowsocks.exe"]
# Stage 1: Build Shadowsocks Windows application FROM mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2019 AS build WORKDIR /src # Copy all repository files COPY . . # Restore NuGet packages and build for x86 Release RUN nuget restore shadowsocks-windows.sln -NonInteractive RUN msbuild shadowsocks-windows.sln /p:Configuration=Release /p:Platform=x86 -m # Stage 2: Runtime image FROM mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019 AS runtime WORKDIR /app # Copy built binaries from the build stage COPY --from=build /src/shadowsocks-csharp/bin/x86/Release/ /app/ # Run the GUI Shadowsocks executable by default CMD ["Shadowsocks.exe"]
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2019 AS build WORKDIR /src COPY . . RUN nuget restore shadowsocks-windows.sln RUN msbuild shadowsocks-windows.sln /p:Configuration=Release /p:Platform=x86 FROM mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019 AS runtime WORKDIR /app COPY --from=build /src/shadowsocks-windows/shadowsocks-csharp/bin/x86/Release/ /app/ ENTRYPOINT ["C:\\app\\Shadowsocks.exe"]
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2019 AS build WORKDIR /src COPY . . RUN nuget restore shadowsocks-windows.sln RUN msbuild shadowsocks-windows.sln /p:Configuration=Release /p:Platform=x86 FROM mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019 AS runtime WORKDIR /app COPY --from=build /src/shadowsocks-windows/shadowsocks-csharp/bin/Release/ /app/ ENTRYPOINT ["C:\\app\\Shadowsocks.exe"]
Image mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2019 NOT found on Docker Hub.
Image mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2019 NOT found on Docker Hub.
No results found.
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2022 AS build WORKDIR /src COPY . . RUN nuget restore shadowsocks-windows.sln RUN msbuild shadowsocks-windows.sln /p:Configuration=Release /p:Platform=x86 FROM mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2022 AS runtime WORKDIR /app COPY --from=build /src/shadowsocks-windows/shadowsocks-csharp/bin/x86/Release/ /app/ ENTRYPOINT ["C:\\app\\Shadowsocks.exe"]
rapidfort/microsoft-sql-server-2019-ib (39 stars): RapidFort optimized, hardened image for Microsoft SQL Server 2019 frankframework/frankframework (2 stars): An easy-to-use, stateless integration framework which allows messages to be modi airbyte/source-microsoft-teams (0 stars): paketobuildpacks/microsoft-openjdk (0 stars): airbyte/source-microsoft-dataverse (0 stars): airbyte/source-microsoft-entra-id (0 stars): airbyte/source-microsoft-lists (0 stars): m365pnp/cli-microsoft365 (10 stars): CLI for Microsoft 365 intel/nmt_marian_framework_demo (0 stars): Docker Image for open-source Neural Machine Translation (NMT) Marian* framework. airbyte/source-microsoft-sharepoint (0 stars):
No results found.
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2019 AS build WORKDIR /src COPY . . RUN nuget restore shadowsocks-windows.sln RUN msbuild shadowsocks-windows.sln /p:Configuration=Release /p:Platform=x86 FROM mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019 AS runtime WORKDIR /app COPY --from=build /src/shadowsocks-windows/shadowsocks-csharp/bin/x86/Release/ /app/ ENTRYPOINT ["C:\\app\\Shadowsocks.exe"]
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8 AS build WORKDIR /src COPY . . RUN nuget restore shadowsocks-windows.sln RUN msbuild shadowsocks-windows.sln /p:Configuration=Release /p:Platform=x86 FROM mcr.microsoft.com/dotnet/framework/runtime:4.8 AS runtime WORKDIR /app COPY --from=build /src/shadowsocks-windows/shadowsocks-csharp/bin/x86/Release/ /app/ ENTRYPOINT ["C:\\app\\Shadowsocks.exe"]
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8
WORKDIR /src
# Copy the source code into the image
COPY . .
# Install NuGet CLI
RUN powershell -NoProfile -ExecutionPolicy Bypass -Command \
New-Item -ItemType Directory -Path C:\\nuget -Force; \
Invoke-WebRequest -Uri https://dist.nuget.org/win-x86-commandline/latest/nuget.exe -OutFile C:\\nuget\\nuget.exe
# Restore dependencies
RUN C:\\nuget\\nuget.exe restore shadowsocks-windows.sln
# Build the solution (Release, Any CPU)
RUN msbuild shadowsocks-windows.sln /p:Configuration=Release /p:Platform="Any CPU"
# Copy the built Shadowsocks.exe to a stable location for running
RUN powershell -NoProfile -ExecutionPolicy Bypass -Command \
if (Test-Path ".\\shadowsocks-csharp\\bin\\Release\\Shadowsocks.exe") { Copy-Item ".\\shadowsocks-csharp\\bin\\Release\\Shadowsocks.exe" "C:\\Shadowsocks.exe" -Force } \
elseif (Test-Path ".\\shadowsocks-csharp\\bin\\x86\\Release\\Shadowsocks.exe") { Copy-Item ".\\shadowsocks-csharp\\bin\\x86\\Release\\Shadowsocks.exe" "C:\\Shadowsocks.exe" -Force } \
else { Write-Output "Build output not found" }
# Run Shadowsocks (note: running GUI apps in Windows containers may require special setup)
CMD ["C:\\Shadowsocks.exe"]
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2022
WORKDIR /src
# Copy the source code into the image
COPY . .
# Install NuGet CLI
RUN powershell -NoProfile -ExecutionPolicy Bypass -Command \
Invoke-WebRequest -Uri https://dist.nuget.org/win-x86-commandline/latest/nuget.exe -OutFile C:\\nuget\\nuget.exe
# Restore dependencies
RUN C:\\nuget\\nuget.exe restore shadowsocks-windows.sln
# Build the solution (Release, Any CPU)
RUN msbuild shadowsocks-windows.sln /p:Configuration=Release /p:Platform="Any CPU"
# Copy the built Shadowsocks.exe to a stable location for running
RUN powershell -NoProfile -ExecutionPolicy Bypass -Command \
if (Test-Path ".\\shadowsocks-csharp\\bin\\Release\\Shadowsocks.exe") { Copy-Item ".\\shadowsocks-csharp\\bin\\Release\\Shadowsocks.exe" "C:\\Shadowsocks.exe" -Force } \
elseif (Test-Path ".\\shadowsocks-csharp\\bin\\x86\\Release\\Shadowsocks.exe") { Copy-Item ".\\shadowsocks-csharp\\bin\\x86\\Release\\Shadowsocks.exe" "C:\\Shadowsocks.exe" -Force } \
else { Write-Output "Build output not found" }
# Run Shadowsocks (note: running GUI apps in Windows containers may require special setup)
CMD ["C:\\Shadowsocks.exe"]
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8
WORKDIR /src
# Copy the source code into the image
COPY . .
# Install NuGet CLI
RUN powershell -NoProfile -ExecutionPolicy Bypass -Command "New-Item -ItemType Directory -Path C:\\nuget -Force; Invoke-WebRequest -Uri https://dist.nuget.org/win-x86-commandline/latest/nuget.exe -OutFile C:\\nuget\\nuget.exe"
# Restore dependencies
RUN C:\\nuget\\nuget.exe restore shadowsocks-windows.sln
# Build the solution (Release, Any CPU)
RUN msbuild shadowsocks-windows.sln /p:Configuration=Release /p:Platform=\"Any CPU\"
# Copy the built Shadowsocks.exe to a stable location for running
RUN powershell -NoProfile -ExecutionPolicy Bypass -Command "if (Test-Path '.\\shadowsocks-csharp\\bin\\Release\\Shadowsocks.exe') { Copy-Item '.\\shadowsocks-csharp\\bin\\Release\\Shadowsocks.exe' 'C:\\Shadowsocks.exe' -Force } elseif (Test-Path '.\\shadowsocks-csharp\\bin\\x86\\Release\\Shadowsocks.exe') { Copy-Item '.\\shadowsocks-csharp\\bin\\x86\\Release\\Shadowsocks.exe' 'C:\\Shadowsocks.exe' -Force } else { Write-Output 'Build output not found' }"
CMD ["C:\\Shadowsocks.exe"]
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8
# Working directory for the build
WORKDIR /src
# Copy everything into the image
COPY . .
# Restore NuGet packages using NuGet CLI
RUN powershell -NoProfile -ExecutionPolicy Bypass -Command \
$ErrorActionPreference = 'Stop'; \
if(!(Test-Path 'C:\\nuget')) { New-Item -ItemType Directory -Path C:\\nuget -Force } ; \
if(!(Test-Path 'C:\\nuget\\nuget.exe')) { Invoke-WebRequest -Uri https://dist.nuget.org/win-x86-commandline/latest/nuget.exe -OutFile C:\\nuget\\nuget.exe } \
'
# Restore dependencies
RUN C:\\nuget\\nuget.exe restore shadowsocks-windows.sln
# Build the solution (Release, Any CPU)
RUN msbuild shadowsocks-windows.sln /p:Configuration=Release /p:Platform="Any CPU"
# Copy built Shadowsocks.exe to a stable location
RUN powershell -NoProfile -ExecutionPolicy Bypass -Command \
if (Test-Path '.\\shadowsocks-csharp\\bin\\Release\\Shadowsocks.exe') { Copy-Item '.\\shadowsocks-csharp\\bin\\Release\\Shadowsocks.exe' 'C:\\Shadowsocks.exe' -Force } \
elseif (Test-Path '.\\shadowsocks-csharp\\bin\\x86\\Release\\Shadowsocks.exe') { Copy-Item '.\\shadowsocks-csharp\\bin\\x86\\Release\\Shadowsocks.exe' 'C:\\Shadowsocks.exe' -Force } \
else { Write-Output 'Build output not found' }
# Run the executable by default (Windows GUI apps inside container may require additional setup)
CMD ["C:\\Shadowsocks.exe"]
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2019
WORKDIR /src
# Copy source into container
COPY . .
# Install NuGet CLI
RUN powershell -NoProfile -ExecutionPolicy Bypass -Command \
if(!(Test-Path 'C:\\nuget')) { New-Item -ItemType Directory -Path C:\\nuget -Force } ; \
Invoke-WebRequest -Uri https://dist.nuget.org/win-x86-commandline/latest/nuget.exe -OutFile C:\\nuget\\nuget.exe
# Restore dependencies
RUN C:\\nuget\\nuget.exe restore shadowsocks-windows.sln
# Build the solution
RUN msbuild shadowsocks-windows.sln /p:Configuration=Release /p:Platform="Any CPU"
# Copy built executable to a stable location
RUN powershell -NoProfile -ExecutionPolicy Bypass -Command \
if (Test-Path '.\\shadowsocks-csharp\\bin\\Release\\Shadowsocks.exe') { Copy-Item '.\\shadowsocks-csharp\\bin\\Release\\Shadowsocks.exe' 'C:\\Shadowsocks.exe' -Force } \
elseif (Test-Path '.\\shadowsocks-csharp\\bin\\x86\\Release\\Shadowsocks.exe') { Copy-Item '.\\shadowsocks-csharp\\bin\\x86\\Release\\Shadowsocks.exe' 'C:\\Shadowsocks.exe' -Force } \
else { Write-Output 'Build output not found' }
CMD ["C:\\Shadowsocks.exe"]
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2022
WORKDIR /src
# Copy source code into the image
COPY . .
# Install NuGet CLI
RUN powershell -NoProfile -ExecutionPolicy Bypass -Command \
if(!(Test-Path 'C:\\nuget')) { New-Item -ItemType Directory -Path C:\\nuget -Force } ; \
Invoke-WebRequest -Uri https://dist.nuget.org/win-x86-commandline/latest/nuget.exe -OutFile C:\\nuget\\nuget.exe
# Restore dependencies
RUN C:\\nuget\\nuget.exe restore shadowsocks-windows.sln
# Build the solution (Release, Any CPU)
RUN msbuild shadowsocks-windows.sln /p:Configuration=Release /p:Platform="Any CPU"
# Copy built Shadowsocks.exe to a stable location for running
RUN powershell -NoProfile -ExecutionPolicy Bypass -Command \
if (Test-Path '.\\shadowsocks-csharp\\bin\\Release\\Shadowsocks.exe') { Copy-Item '.\\shadowsocks-csharp\\bin\\Release\\Shadowsocks.exe' 'C:\\Shadowsocks.exe' -Force } \
elseif (Test-Path '.\\shadowsocks-csharp\\bin\\x86\\Release\\Shadowsocks.exe') { Copy-Item '.\\shadowsocks-csharp\\bin\\x86\\Release\\Shadowsocks.exe' 'C:\\Shadowsocks.exe' -Force } \
else { Write-Output 'Build output not found' }
CMD ["C:\\Shadowsocks.exe"]
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8
WORKDIR /src
# Copy source into container
COPY . .
# Install NuGet CLI
RUN powershell -NoProfile -ExecutionPolicy Bypass -Command \
if(!(Test-Path 'C:\\nuget')) { New-Item -ItemType Directory -Path C:\\nuget -Force } ; \
Invoke-WebRequest -Uri https://dist.nuget.org/win-x86-commandline/latest/nuget.exe -OutFile C:\\nuget\\nuget.exe
# Restore dependencies
RUN C:\\nuget\\nuget.exe restore shadowsocks-windows.sln
# Build the solution (Release, Any CPU)
RUN msbuild shadowsocks-windows.sln /p:Configuration=Release /p:Platform="Any CPU"
# Copy built Shadowsocks.exe to a stable location for running
RUN powershell -NoProfile -ExecutionPolicy Bypass -Command \
if (Test-Path '.\\shadowsocks-csharp\\bin\\Release\\Shadowsocks.exe') { Copy-Item '.\\shadowsocks-csharp\\bin\\Release\\Shadowsocks.exe' 'C:\\Shadowsocks.exe' -Force } \
elseif (Test-Path '.\\shadowsocks-csharp\\bin\\x86\\Release\\Shadowsocks.exe') { Copy-Item '.\\shadowsocks-csharp\\bin\\x86\\Release\\Shadowsocks.exe' 'C:\\Shadowsocks.exe' -Force } \
else { Write-Output 'Build output not found' }
CMD ["C:\\Shadowsocks.exe"]
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2019
WORKDIR /src
# Copy source into container
COPY . .
# Install NuGet CLI
RUN powershell -NoProfile -ExecutionPolicy Bypass -Command \
if(!(Test-Path 'C:\\nuget')) { New-Item -ItemType Directory -Path C:\\nuget -Force } ; \
Invoke-WebRequest -Uri https://dist.nuget.org/win-x86-commandline/latest/nuget.exe -OutFile C:\\nuget\\nuget.exe
# Restore dependencies
RUN C:\\nuget\\nuget.exe restore shadowsocks-windows.sln
# Build the solution (Release, Any CPU)
RUN msbuild shadowsocks-windows.sln /p:Configuration=Release /p:Platform=\"Any CPU\"
# Copy built Shadowsocks.exe to a stable location
RUN powershell -NoProfile -ExecutionPolicy Bypass -Command \
if (Test-Path '.\\shadowsocks-csharp\\bin\\Release\\Shadowsocks.exe') { Copy-Item '.\\shadowsocks-csharp\\bin\\Release\\Shadowsocks.exe' 'C:\\Shadowsocks.exe' -Force } \
elseif (Test-Path '.\\shadowsocks-csharp\\bin\\x86\\Release\\Shadowsocks.exe') { Copy-Item '.\\shadowsocks-csharp\\bin\\x86\\Release\\Shadowsocks.exe' 'C:\\Shadowsocks.exe' -Force } \
else { Write-Output 'Build output not found' }
CMD ["C:\\Shadowsocks.exe"]
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8
WORKDIR /src
# Copy source into container
COPY . .
# Install NuGet CLI
RUN powershell -NoProfile -ExecutionPolicy Bypass -Command \
$ErrorActionPreference = 'Stop'; \
if(!(Test-Path 'C:\\nuget')) { New-Item -ItemType Directory -Path C:\\nuget -Force }; \
(New-Object System.Net.WebClient).DownloadFile('https://dist.nuget.org/win-x86-commandline/latest/nuget.exe','C:\\nuget\\nuget.exe')
# Restore dependencies
RUN C:\\nuget\\nuget.exe restore shadowsocks-windows.sln
# Build the solution (Release, Any CPU)
RUN msbuild shadowsocks-windows.sln /p:Configuration=Release /p:Platform="Any CPU"
# Copy built Shadowsocks.exe (and supporting files) to a stable location
RUN powershell -NoProfile -ExecutionPolicy Bypass -Command \
$src = '.\\shadowsocks-csharp\\bin\\Release'; \
if (Test-Path $src) { New-Item -ItemType Directory -Path 'C:\\Shadowsocks' -Force | Out-Null; Copy-Item "$src\\*" 'C:\\Shadowsocks' -Recurse -Force } \
else { $src2 = '.\\shadowsocks-csharp\\bin\\x86\\Release'; if (Test-Path $src2) { New-Item -ItemType Directory -Path 'C:\\Shadowsocks' -Force | Out-Null; Copy-Item "$src2\\*" 'C:\\Shadowsocks' -Recurse -Force } else { Write-Host 'Build output not found' } }
# Run Shadowsocks (GUI app in a Windows container may require an interactive session)
CMD ["C:\\Shadowsocks\\Shadowsocks.exe"]
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2022
WORKDIR /src
# Copy source into container
COPY . .
# Install NuGet CLI
RUN powershell -NoProfile -ExecutionPolicy Bypass -Command \
if(!(Test-Path 'C:\\nuget')) { New-Item -ItemType Directory -Path C:\\nuget -Force }; \
(New-Object System.Net.WebClient).DownloadFile('https://dist.nuget.org/win-x86-commandline/latest/nuget.exe','C:\\nuget\\nuget.exe')
# Restore dependencies
RUN C:\\nuget\\nuget.exe restore shadowsocks-windows.sln
# Build the solution (Release, Any CPU)
RUN msbuild shadowsocks-windows.sln /p:Configuration=Release /p:Platform="Any CPU"
# Copy built Shadowsocks.exe to a stable location for running
RUN powershell -NoProfile -ExecutionPolicy Bypass -Command \
$outPaths = @(".\\shadowsocks-csharp\\bin\\Release\\Shadowsocks.exe",".\\shadowsocks-csharp\\bin\\Release\\Shadowsocks.exe",".\\shadowsocks-csharp\\bin\\x86\\Release\\Shadowsocks.exe"); \
foreach($p in $outPaths) { if (Test-Path $p) { Copy-Item $p 'C:\\Shadowsocks.exe' -Force; exit 0 } }; \
Write-Output 'Build output not found'; exit 1
CMD ["C:\\Shadowsocks.exe"]
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8 WORKDIR /src # Copy source into container COPY . . # Restore NuGet packages RUN powershell -Command ""
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8
# Use PowerShell for Windows container commands
SHELL ["powershell", "-NoProfile", "-ExecutionPolicy", "Bypass"]
WORKDIR /src
# Copy source into container
COPY . .
# Install NuGet CLI, then restore and build
RUN $ErrorActionPreference = 'Stop'; \
if(!(Test-Path 'C:\\nuget')) { New-Item -ItemType Directory -Path 'C:\\nuget' -Force }; \
Invoke-WebRequest -Uri 'https://dist.nuget.org/win-x86-commandline/latest/nuget.exe' -OutFile 'C:\\nuget\\nuget.exe'; \
& 'C:\\nuget\\nuget.exe' restore shadowsocks-windows.sln; \
MSBuild shadowsocks-windows.sln /p:Configuration=Release /p:Platform="Any CPU";
# Copy built Shadowsocks.exe to a stable location
RUN $out1 = '.\\shadowsocks-csharp\\bin\\Release\\Shadowsocks.exe'; \
$out2 = '.\\shadowsocks-csharp\\bin\\x86\\Release\\Shadowsocks.exe'; \
if(Test-Path $out1) { New-Item -ItemType Directory -Path 'C:\\Shadowsocks' -Force; Copy-Item $out1 'C:\\Shadowsocks\\Shadowsocks.exe' -Force } \
elseif(Test-Path $out2) { New-Item -ItemType Directory -Path 'C:\\Shadowsocks' -Force; Copy-Item $out2 'C:\\Shadowsocks\\Shadowsocks.exe' -Force } \
else { Write-Output 'Build output not found' }
# Default command: attempt to run Shadowsocks (GUI app); container runtimes may require a UI session
CMD ["C:\\Shadowsocks\\Shadowsocks.exe"]
FROM microsoft/dotnet-framework-sdk:4.8-windowsservercore-ltsc2019
SHELL ["powershell", "-NoProfile", "-ExecutionPolicy", "Bypass"]
WORKDIR /src
# Copy source code into the image
COPY . .
# Install NuGet CLI
RUN if(!(Test-Path 'C:\\nuget')) { New-Item -ItemType Directory -Path 'C:\\nuget' -Force }; \
Invoke-WebRequest -Uri 'https://dist.nuget.org/win-x86-commandline/latest/nuget.exe' -OutFile 'C:\\nuget\\nuget.exe'
# Restore dependencies
RUN C:\\nuget\\nuget.exe restore shadowsocks-windows.sln
# Build the solution (Release, Any CPU)
RUN msbuild shadowsocks-windows.sln /p:Configuration=Release /p:Platform="Any CPU"
# Copy built Shadowsocks.exe to a stable location
RUN powershell -NoProfile -ExecutionPolicy Bypass -Command \
$out1 = '.\\shadowsocks-csharp\\bin\\Release\\Shadowsocks.exe'; \
$out2 = '.\\shadowsocks-csharp\\bin\\x86\\Release\\Shadowsocks.exe'; \
if(Test-Path $out1) { New-Item -ItemType Directory -Path 'C:\\Shadowsocks' -Force; Copy-Item $out1 'C:\\Shadowsocks\\Shadowsocks.exe' -Force } \
elseif(Test-Path $out2) { New-Item -ItemType Directory -Path 'C:\\Shadowsocks' -Force; Copy-Item $out2 'C:\\Shadowsocks\\Shadowsocks.exe' -Force } \
else { Write-Output 'Build output not found' }
CMD ["C:\\Shadowsocks\\Shadowsocks.exe"]
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8
SHELL ["powershell", "-NoProfile", "-ExecutionPolicy", "Bypass"]
WORKDIR /src
# Copy source into container
COPY . .
# Install NuGet CLI
RUN if(!(Test-Path 'C:\\nuget')) { New-Item -ItemType Directory -Path 'C:\\nuget' -Force } ; \
Invoke-WebRequest -Uri 'https://dist.nuget.org/win-x86-commandline/latest/nuget.exe' -OutFile 'C:\\nuget\\nuget.exe'
# Restore dependencies
RUN C:\\nuget\\nuget.exe restore shadowsocks-windows.sln
# Build the solution (Release, Any CPU)
RUN msbuild shadowsocks-windows.sln /p:Configuration=Release /p:Platform=\"Any CPU\"
# Copy built Shadowsocks.exe to a stable location for running
RUN if(Test-Path '.\\shadowsocks-csharp\\bin\\Release\\Shadowsocks.exe') { New-Item -ItemType Directory -Path 'C:\\Shadowsocks' -Force; Copy-Item '.\\shadowsocks-csharp\\bin\\Release\\*' 'C:\\Shadowsocks' -Recurse -Force } ; \
if(Test-Path '.\\shadowsocks-csharp\\bin\\x86\\Release\\Shadowsocks.exe') { New-Item -ItemType Directory -Path 'C:\\Shadowsocks' -Force; Copy-Item '.\\shadowsocks-csharp\\bin\\x86\\Release\\*' 'C:\\Shadowsocks' -Recurse -Force }
# Run Shadowsocks (GUI app) - running in a container may require UI setup; this image will serve for build
CMD ["C:\\Shadowsocks\\Shadowsocks.exe"]
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8
# Working directory inside the image
WORKDIR /src
# Copy source files
COPY . .
# Install NuGet CLI
RUN powershell -NoProfile -ExecutionPolicy Bypass -Command \
if(!(Test-Path 'C:\\nuget')) { New-Item -ItemType Directory -Path 'C:\\nuget' -Force }; \
Invoke-WebRequest -Uri 'https://dist.nuget.org/win-x86-commandline/latest/nuget.exe' -OutFile 'C:\\nuget\\nuget.exe'
# Restore NuGet packages
RUN C:\\nuget\\nuget.exe restore shadowsocks-windows.sln
# Build the solution (Release, Any CPU)
RUN msbuild shadowsocks-windows.sln /p:Configuration=Release /p:Platform="Any CPU"
# Copy built Shadowsocks.exe to a stable location for running
RUN powershell -NoProfile -ExecutionPolicy Bypass -Command \
if (Test-Path '.\\shadowsocks-csharp\\bin\\Release\\Shadowsocks.exe') { New-Item -ItemType Directory -Path 'C:\\Shadowsocks' -Force; Copy-Item '.\\shadowsocks-csharp\\bin\\Release\\Shadowsocks.exe' 'C:\\Shadowsocks\\Shadowsocks.exe' -Force } \
elseif (Test-Path '.\\shadowsocks-csharp\\bin\\x86\\Release\\Shadowsocks.exe') { New-Item -ItemType Directory -Path 'C:\\Shadowsocks' -Force; Copy-Item '.\\shadowsocks-csharp\\bin\\x86\\Release\\Shadowsocks.exe' 'C:\\Shadowsocks\\Shadowsocks.exe' -Force } \
else { Write-Output 'Build output not found' }
# Default command to run Shadowsocks (GUI app). UI may require additional setup in containers.
CMD ["C:\\Shadowsocks\\Shadowsocks.exe"]