I'm new in docker and I have a problem I can't deal with. I created .net core MVC application and this app is supposed to work on raspberry pi, so I dockerized my app on raspberry on HypriotOS and everything is good, but some images from wwwroot (default static files folder) is not Found (404). In wwwroot folder I have some css, js and images files and css, js and few images are available, but few .png files no. I don't have idea why.
My Dockerfile
FROM mcr.microsoft.com/dotnet/core/sdk:2.2 AS build
WORKDIR /app
# copy csproj and restore as distinct layers
COPY *.csproj ./
RUN dotnet restore
# copy everything else and build app
COPY . ./
RUN dotnet publish -c Release -o out
FROM mcr.microsoft.com/dotnet/core/aspnet:2.2 AS runtime
WORKDIR /app
COPY --from=build /app/out .
ENTRYPOINT ["dotnet", "TestApp.dll"]
Commands to build and run Docker image:
docker build -t testapp .
docker run -p 8080:80 --name testapp testapp
Dockerize passes correctly, no errors. The application is accessible from the outside, everything works, but some graphics are not displayed (404 Not Found).
Check your .dockerignore file for anything that might match the missing files/path. That's what fixed this for me.