Open Closed

Docker build failure #2459


User avatar
2
AlderCove created

Check the samples, to seea the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index The exact solution to yoaur question may have been answered before, please use the search on the homepage.

If you're creating a bug/problem report, please include followings:

  • ABP Framework version: v5.1.2
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:

  • Steps to reproduce the issue:"

Create a new application using ABP suite, add docker support and try to build the image from the command line (docker build -f ./src/TestDocker.Web/Dockerfile . -t testdocker512:latest)

Dockerfile

The NuGet.Config has an entry for ABP Commercial with the API key.

This was working for me prior to updating to 5.1.1 and 5.1.2.


5 Answer(s)
  • User Avatar
    0
    MichelZ created

    We get the same issue. Additionally we see a few of these errors:

    #37 145.3 /usr/share/dotnet/sdk/6.0.101/Microsoft.Common.CurrentVersion.targets(2304,5): warning MSB3106: Assembly strong name "/root/.nuget/packages/volo.abp.commercial.core/5.1.2/lib/netstandard2.0/Volo.Abp.Commercial.Core.dll" is either a path which could not be found or it is a full assembly name which is badly formed. If it is a full assembly name it may contain characters that need to be escaped with backslash(\). Those characters are Equals(=), Comma(,), Quote("), Apostrophe('), Backslash(\). [/src/src/company.product.Domain.Shared/company.product.Domain.Shared.csproj]

  • User Avatar
    0
    AlderCove created

    related badly formed path issue for linux I think:

    https://support.abp.io/QA/Questions/2209/Bugs--Issues-v5X#answer-9ad254be-2d53-a4ca-0fe9-3a0191e0d611

  • User Avatar
    0
    gterdem created
    Support Team Senior .NET Developer

    This was working for me prior to updating to 5.1.1 and 5.1.2.

    I have reproduced this issue. It seems like related with wrong path format for linux as @AlderCove mentioned above. We'll investigate further. Thank you.

  • User Avatar
    0
    boltth created

    By the way: That's the same issue I already submitted in the following thread: https://support.abp.io/QA/Questions/2476/Conflict-409-on-package-download

    In the meantime we could analyze what happened. But there's actually no fix for the issue.

    After restoring the nuget packages in a linux container, some packages like 'Volo.Abp.LanguageManagement.Application' are clearly stored in a wrong folder structure in the nuget package store in ~/.nuget/packages/ In fact, filenames are completely wrong, what leads to the problem, that the build-process doesn't find the assemblies.

    The screenshot shows that the filename of the dll for example starts and ends with an apostrophe and contains the folder-structure as a string. Please also note that the folders within that string are separated by a backslash instead of a slash what would be normal in linux.

  • User Avatar
    0
    gterdem created
    Support Team Senior .NET Developer

    5.1.3 is live now. I was able to build docker image after updating the cli then solution to version 5.1.3.

    This is the Dockerfile under TestDocker.Web project I have used:

    FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
    WORKDIR /app
    EXPOSE 80
    EXPOSE 443
    
    FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
    WORKDIR /src
    COPY ["NuGet.Config", "."]
    COPY ["src/TestDocker.Web/TestDocker.Web.csproj", "src/TestDocker.Web/"]
    COPY ["src/TestDocker.HttpApi/TestDocker.HttpApi.csproj", "src/TestDocker.HttpApi/"]
    COPY ["src/TestDocker.Application.Contracts/TestDocker.Application.Contracts.csproj", "src/TestDocker.Application.Contracts/"]
    COPY ["src/TestDocker.Domain.Shared/TestDocker.Domain.Shared.csproj", "src/TestDocker.Domain.Shared/"]
    COPY ["src/TestDocker.HttpApi.Client/TestDocker.HttpApi.Client.csproj", "src/TestDocker.HttpApi.Client/"]
    RUN dotnet restore "src/TestDocker.Web/TestDocker.Web.csproj"
    COPY . .
    WORKDIR "/src/src/TestDocker.Web"
    RUN dotnet build "TestDocker.Web.csproj" -c Release -o /app/build
    
    FROM build AS publish
    RUN dotnet publish "TestDocker.Web.csproj" -c Release -o /app/publish
    
    FROM base AS final
    WORKDIR /app
    COPY --from=publish /app/publish .
    ENTRYPOINT ["dotnet", "TestDocker.Web.dll"]
    

    Let me know if you still get any error.

    @AlderCove I have refunded your question. Thanks for reporting!

Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11