Outdated Dockerfile #42775
Labels
dotnet-docker/subsvc
dotnet-fundamentals/svc
in-pr
This issue will be closed (fixed) by an active pull request.
📌 seQUESTered
Identifies that an issue has been imported into Quest.
Type of issue
Other (describe below)
Description
As per the latest official documentation for the following Dockerfile command:
# Build and publish a release
RUN dotnet publish -c Release -o out
.NET 7.0.200 SDK and later
If you specify the --output option when running this command on a solution, the CLI will emit a warning (an error in 7.0.200) due to the unclear semantics of the output path. The --output option is disallowed because all outputs of all built projects would be copied into the specified directory, which isn't compatible with multi-targeted projects, as well as projects that have different versions of direct and transitive dependencies. For more information, see Solution-level --output option no longer valid for build-related commands.
According to the relevant linked article the "Recommended action" is to remove the -o (--output) option and replace
COPY --from=build-env /App/out .
with
COPY --from=build-env /App/bin/[configuration]/[framework]/[runtime]/publish/ .
Page URL
https://learn.microsoft.com/en-us/dotnet/core/docker/build-container?tabs=linux&pivots=dotnet-8-0
Content source URL
https://github.com/dotnet/docs/blob/main/docs/core/docker/build-container.md
Document Version Independent Id
58d57b81-4ca6-6536-8788-f212402b41a7
Article author
@IEvangelist
Metadata
Related Issues
Associated WorkItem - 360317
The text was updated successfully, but these errors were encountered: