Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerfile #422

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.dockerignore
.github
docs
Dockerfile
chocolatey-packages
51 changes: 51 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# escape=`

FROM mcr.microsoft.com/dotnet/framework/sdk:3.5-windowsservercore-ltsc2019 as Build

# Set cmd as default shell
SHELL ["cmd", "/S", "/C"]

# Setup vs_buildtools.exe
ADD https://aka.ms/vs/16/release/channel C:\TEMP\VisualStudio.chman
ADD https://aka.ms/vs/16/release/vs_buildtools.exe C:\TEMP\vs_buildtools.exe

# VS2019 C++ stuff
RUN C:\TEMP\vs_buildtools.exe --quiet --wait --norestart --nocache `
--installPath C:\BuildTools `
--channelUri C:\TEMP\VisualStudio.chman `
--installChannelUri C:\TEMP\VisualStudio.chman `
--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 `
|| if "%ERRORLEVEL%"=="3010" exit /b 0

# 10 SDK
RUN C:\TEMP\vs_buildtools.exe --quiet --wait --norestart --nocache `
--installPath C:\BuildTools `
--channelUri C:\TEMP\VisualStudio.chman `
--installChannelUri C:\TEMP\VisualStudio.chman `
--add Microsoft.VisualStudio.Component.Windows10SDK.19041 `
|| if "%ERRORLEVEL%"=="3010" exit /b 0

# NetCore SDK
RUN C:\TEMP\vs_buildtools.exe --quiet --wait --norestart --nocache `
--installPath C:\BuildTools `
--channelUri C:\TEMP\VisualStudio.chman `
--installChannelUri C:\TEMP\VisualStudio.chman `
--add Microsoft.NetCore.Component.SDK `
|| if "%ERRORLEVEL%"=="3010" exit /b 0

# Add the source code
ADD . C:/source
WORKDIR C:/source

# Restore nuget packages
RUN msbuild Confuser2.sln /t:Restore /p:Configuration=Release

# Set VS environment and compile
RUN call C:\BuildTools\VC\Auxiliary\Build\vcvarsall.bat amd64 && `
msbuild /maxCpuCount Confuser2.sln /p:Configuration=Release /verbosity:minimal

# Create new image
FROM mcr.microsoft.com/dotnet/framework/runtime:3.5-windowsservercore-ltsc2019 as ConfuserEx2
COPY --from=Build C:/source/Confuser.CLI/bin/Release/net461 C:/ConfuserEx2

ENTRYPOINT [ "C:/ConfuserEx2/Confuser.CLI.exe" ]
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,20 @@ Confuser.CLI.exe <path to project file>
The project file is a ConfuserEx Project (`*.crproj`).
The format of project file can be found in [docs\ProjectFormat.md][project_format]

## Dockerfile

Compile

```cmd
docker build --memory=4GB --tag confuserex2 .
```

Use

```cmd
docker run --rm --cpus=%NUMBER_OF_PROCESSORS% --memory=4GB --volume %CD%:C:/source confuserex2 C:/source/project.crproj
```

# Bug Report

See the [Issues Report][issues] section of website.
Expand Down