Posted 26 October 2023, 1:35 am EST - Updated 26 October 2023, 3:38 am EST
I am trying to get a dotnet 6.0 Dockerfile based build working while licensing Active Reports 16, and I’ve yet to have any success. I believe have followed the recommended way of doing this via the gclm tool. My Dockerfile contains the following snippet centred around licensing the application:
# Run restore as a distinct layer.
RUN dotnet restore "src/Reports.API/Reports.API.csproj"
COPY . .
WORKDIR "/App/src/Reports.API"
FROM build-env AS publish
ENV PATH="${PATH}:/root/.dotnet/tools"
RUN dotnet tool install -g GrapeCity.LicenseManagerTool
RUN gclm "5e0b5f44-1a6b-4aff-a007-17b9224bca83" -lc ./.gclicx "Reports.API.dll"
# Build and publish a release
RUN dotnet publish "Reports.API.csproj" --no-restore -c Release -o /App/out /p:UseAppHost=false
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS runtime-env
EXPOSE 80
WORKDIR /App
COPY --from=publish /App/out .
ENTRYPOINT ["dotnet", "Reports.API.dll"]
When performing a Docker build I’m receving the following error from the gclm tool: error: Failed to generate license for 5e0b5f44-1a6b-4aff-a007-17b9224bca83. Details: No License.
The .gclicx was generated on a licensed Windows machine using both VS2022, and when that file failed in the Docker build, I used the tool installed in C:\ProgramData\GrapeCity\gclm which produced a file with the same contents that also failed.
I am ultimately using the above method because we wish to perform builds via a devops pipeline for releases (as well as local builds), and we do not want to purchase another license just to license the pipeline.