Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
docker_basic_dockerize [2020/05/02 18:04] – [Troubleshooting] andonovj | docker_basic_dockerize [2020/05/03 11:49] (current) – [Wrong ASP.NET] andonovj | ||
---|---|---|---|
Line 169: | Line 169: | ||
You can have the following error: | You can have the following error: | ||
+ | |||
+ | ====Searching wrong Nuget==== | ||
<Code: C#|Nuget Issue> | <Code: C#|Nuget Issue> | ||
Restore completed in 41.36 ms for / | Restore completed in 41.36 ms for / | ||
Line 197: | Line 199: | ||
RUN find -type d -name bin -prune -exec rm -rf {} \; && find -type d -name obj -prune -exec rm -rf {} \; <- This line | RUN find -type d -name bin -prune -exec rm -rf {} \; && find -type d -name obj -prune -exec rm -rf {} \; <- This line | ||
ENTRYPOINT [" | ENTRYPOINT [" | ||
+ | </ | ||
+ | |||
+ | |||
+ | ====Wrong ASP.NET==== | ||
+ | Be careful about the dockerizing the application. I tried to build the application with ASP.NET 2.2 while the app was build with ASP.NET 3.1, so I had to update my Dockerfile as follows: | ||
+ | |||
+ | <Code: bash| Updated Docker File> | ||
+ | FROM mcr.microsoft.com/ | ||
+ | WORKDIR /app | ||
+ | |||
+ | # Copy csproj and restore as distinct layers | ||
+ | COPY *.csproj ./ | ||
+ | RUN dotnet restore | ||
+ | |||
+ | # Copy everything else and build | ||
+ | COPY . ./ | ||
+ | RUN dotnet publish -c Release -o out | ||
+ | |||
+ | # Build runtime image | ||
+ | #FROM mcr.microsoft.com/ | ||
+ | FROM mcr.microsoft.com/ | ||
+ | WORKDIR /app | ||
+ | COPY --from=build-env /app/out . | ||
+ | ENTRYPOINT [" | ||
+ | </ | ||
+ | |||
+ | Otherwise, you will receive the following error: | ||
+ | |||
+ | <Code: bash| Error for wrong ASP.NET version> | ||
+ | It was not possible to find any compatible framework version | ||
+ | The specified framework ' | ||
+ | - Check application dependencies and target a framework version installed at: | ||
+ | / | ||
+ | - Installing .NET Core prerequisites might help resolve this problem: | ||
+ | https:// | ||
+ | - The .NET Core framework and SDK can be installed from: | ||
+ | https:// | ||
+ | - The following versions are installed: | ||
+ | 2.2.8 at [/ | ||
</ | </ |