24

I am trying to build my ASP.NET 4.7.2 WEB Services into a docker file, however when I run

docker build -t manufacturing-portal-api:latest .

I get the following error:

failed to register layer: Error processing tar file(exit status 1): link /Files/Program Files/common files/system/ado/en-US/msader15.dll.mui /Files/Program Files (x86)/common files/system/ado/en-US/msader15.dll.mui: no such file or directory=> => sha256:d9e8b01179bfc94a5bdb1810fbd76b999aa52016001ace2d3a4c4bc7065a9601 1.66GB / 1.66GB                     0.0s

This is my docker file

FROM microsoft/dotnet-framework:4.7.2-sdk-windowsservercore-1803 AS build
WORKDIR /app

# copy csproj and restore as distinct layers
COPY *.sln .
COPY WebPortalAPI/*.csproj ./WebPortalAPI/
COPY WebPortalAPI/*.config ./WebPortalAPI/
COPY ./instantclient_11_2 .
ENV PATH=./instantclient_11_2
ENV TNS_ADMIN=./instantclient_11_2/network/admin
RUN nuget restore

# copy everything else and build app
COPY WebPortalAPI/. ./WebPortalAPI/
WORKDIR /app/WebPortalAPI
RUN msbuild /p:Configuration=Release


FROM microsoft/aspnet:4.7.2-windowsservercore-1803 AS runtime
WORKDIR /inetpub/wwwroot
COPY --from=build /app/WebPortalAPI/. ./

please advise

1
  • 1
    Still getting this error even after switching to Windows Containers. Any other solution? Commented Sep 27, 2021 at 18:14

1 Answer 1

42

Your Docker host is likely configured to run Linux containers inside of a VM. To run Windows containers, you need to "Switch to Windows containers" in the Docker context menu (on the taskbar icon). Documentation on that is available here.

Sign up to request clarification or add additional context in comments.

3 Comments

I'm already in "Windows containers" mode and am still getting this error. Using FROM --platform=windows/x86-64 python:3.10.4-windowsservercore.
@eccentricOrange same here. Still getting the error while having Docker on windows containers. Used FROM --platform=windows/amd64 mcr.microsoft.com/windows/server:ltsc2022-amd64, and tried to build the Docker but it failed after downloading everything. Did you manage to solve that ?
Right-click on the Docker icon in the system tray and select "Switch to Windows containers" from the context menu.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.