OrchardCMS / OrchardCore

Orchard Core is an open-source modular and multi-tenant application framework built with ASP.NET Core, and a content management system (CMS) built on top of that framework.
https://orchardcore.net
BSD 3-Clause "New" or "Revised" License
7.43k stars 2.4k forks source link

docker build error #16793

Closed fuzzbuzzz closed 1 month ago

fuzzbuzzz commented 1 month ago

Discussed in https://github.com/OrchardCMS/OrchardCore/discussions/16366

Originally posted by **tcobbfis** June 24, 2024 In order to meet security requirements (45 day password expire), I need to change the users module (login function). When trying to edit and build with source code I get the error below. Also, is editing the source the right way to make this change? I tried creating an altered users module over the weekend, but had trouble when trying to replace the built in users module with it. PS C:\Repos\Orchard> docker compose up --build 2024/06/24 11:32:47 http2: server: error reading preface from client //./pipe/dockerDesktopLinuxEngine: file has already been closed [+] Building 15.2s (9/9) FINISHED docker:desktop-linux => [fisorchard internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 371B 0.0s => [fisorchard internal] load metadata for mcr.microsoft.com/dotnet/sdk:8.0 0.9s => [fisorchard internal] load .dockerignore 0.1s => => transferring context: 291B 0.0s => [fisorchard build-env 1/5] FROM mcr.microsoft.com/dotnet/sdk:8.0@sha256:3189e564f19e016a43838a46609fc81349f07322fdf6bc3299bd13f0dca9e647 0.0s => [fisorchard internal] load build context 1.8s => => transferring context: 1.12MB 1.7s => CACHED [fisorchard build-env 2/5] WORKDIR /app 0.0s => CACHED [fisorchard build-env 3/5] COPY ./src /app 0.0s => CACHED [fisorchard build-env 4/5] COPY Directory.Build.props / 0.0s => ERROR [fisorchard build-env 5/5] RUN dotnet publish /app/OrchardCore.Cms.Web -c Release -o ./build/release --framework net8.0 /p:RunAnalyzers=false 12.3s ------ > [fisorchard build-env 5/5] RUN dotnet publish /app/OrchardCore.Cms.Web -c Release -o ./build/release --framework net8.0 /p:RunAnalyzers=false: 1.384 Determining projects to restore... 11.73 /usr/share/dotnet/sdk/8.0.302/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(96,5): error NETSDK1013: The TargetFramework value '' was not recognized. It may be misspelled. If not, then the TargetFrameworkIdentifier and/or TargetFrameworkVersion properties must be specified explicitly. [/app/OrchardCore.Cms.Web/OrchardCore.Cms.Web.csproj] ------ failed to solve: process "/bin/sh -c dotnet publish /app/OrchardCore.Cms.Web -c Release -o ./build/release --framework net8.0 /p:RunAnalyzers=false" did not complete successfully: exit code: 1
github-actions[bot] commented 1 month ago

Thank you for submitting your first issue, awesome! 🚀 We're thrilled to receive your input. If you haven't completed the template yet, please take a moment to do so. This ensures that we fully understand your feature request or bug report. On what happens next, see the docs.

If you like Orchard Core, please star our repo and join our community channels.

fuzzbuzzz commented 1 month ago

hi there,

When I have forked the 2.0.0 release branch (https://github.com/OrchardCMS/OrchardCore/releases/tag/v2.0.0) and executing the docker build . command, I'm receiving this error:

` => ERROR [build-env 5/5] RUN dotnet publish /app/OrchardCore.Cms.Web -c Release -o ./build/release --framework net8.0 /p:RunAnalyzers=false 2.6s


[build-env 5/5] RUN dotnet publish /app/OrchardCore.Cms.Web -c Release -o ./build/release --framework net8.0 /p:RunAnalyzers=false:
0.507 Determining projects to restore...
2.565 /usr/share/dotnet/sdk/8.0.402/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(96,5): error NETSDK1013: The TargetFramework value '' was not recognized. It may be misspelled. If not, then the TargetFrameworkIdentifier and/or TargetFrameworkVersion properties must be specified explicitly. [/app/OrchardCore.Cms.Web/OrchardCore.Cms.Web.csproj]

Dockerfile:12

10 | COPY Directory.Build.props / 11 |
12 | >>> RUN dotnet publish /app/OrchardCore.Cms.Web -c Release -o ./build/release --framework net8.0 /p:RunAnalyzers=false 13 |
14 | # Build runtime image

ERROR: failed to solve: process "/bin/sh -c dotnet publish /app/OrchardCore.Cms.Web -c Release -o ./build/release --framework net8.0 /p:RunAnalyzers=false" did not complete successfully: exit code: 1 `

Can someone advise? 💯

Thank you

github-actions[bot] commented 1 month ago

We triaged this issue and set the milestone according to the priority we think is appropriate (see the docs on how we triage and prioritize issues).

This indicates when the core team may start working on it. However, if you'd like to contribute, we'd warmly welcome you to do that anytime. See our guide on contributions here.

sebastienros commented 1 month ago

I can reproduce the issue locally. I am having issue copying the Directory.Packages.props file which is required.