-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Description
Description
Attempting to run the Hello World console app, that was published as a single file deployment, in a Windows 10.0.17763 container will fail with an error message similar to the following:
Failed to map file. CreateFileMappingW(C:\app\app.exe) failed with error 5
Failure processing application bundle.
Failed to map bundle file [C:\app\app.runtimeconfig.json]
This behavior applies to both 5.0 and 6.0. It works in .NET Core 2.1 and 3.1. And it only occurs when targeting a Windows 10.0.17763 container (this version maps to Windows 10 version 1809 and Windows Server 2019). Targeting newer or older versions of Windows containers also works. I've attempted to repro this outside of a container environment, just on a Windows Server 2019 machine directly and it worked fine. Things also work fine if you attempt to run an app that was published without the single file option so the failure is specific to that option.
Repro
On a machine with Docker installed and targeting Windows containers:
- Create a new empty directory
- Add a file named
Dockerfilewith the following content:
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /app
RUN dotnet new console
RUN dotnet publish -c release -o /out -r win-x64 /p:PublishSingleFile=true
FROM mcr.microsoft.com/windows/nanoserver:1809
WORKDIR /app
COPY --from=build /out .
ENTRYPOINT ["app"]docker build -t app .docker run --rm app
Configuration
The environment I'm running:
- Windows 10, version 21H1
- Docker
❯ docker version
Client:
Cloud integration: 1.0.17
Version: 20.10.7
API version: 1.41
Go version: go1.16.4
Git commit: f0df350
Built: Wed Jun 2 12:00:56 2021
OS/Arch: windows/amd64
Context: desktop-windows
Experimental: true
Server: Docker Engine - Community
Engine:
Version: 20.10.7
API version: 1.41 (minimum version 1.24)
Go version: go1.13.15
Git commit: b0f5bc3
Built: Wed Jun 2 11:56:41 2021
OS/Arch: windows/amd64
Experimental: true
Regression?
This works in .NET Core 2.1 and 3.1. It started failing with 5.0.100.