Click here to Skip to main content
15,890,609 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
My net core 5 API project builds and runs perfectly on an ARM64 SBC running Armbian. But when I try to run it in a Docker container it builds fine but gives an error when I try to run it 'Could not load file or assembly ‘/MyAPI.dll’. The system cannot find the file specified. I think it must be path related but can't see anything obviously wrong with the Dockerfile

What I have tried:

Building using this Dockerfile ( From Microsoft )
# Get Base Image (Full .NET Core SDK)
FROM mcr.microsoft.com/dotnet/sdk AS build-env
WORKDIR /app

# Copy csproj and restore
COPY *.csproj ./
RUN dotnet restore

# Copy everything else and build
COPY . ./
RUN dotnet publish -c Release -o out

# Generate runtime image
FROM mcr.microsoft.com/dotnet/aspnet
COPY --from=build-env /app/out/ .
ENTRYPOINT ["dotnet", "MyAPI.dll"]
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900