FROM ubuntu:jammy-20260217
# Install prerequisites and .NET 10 SDK (preview) from Microsoft packages
ENV DEBIAN_FRONTEND=noninteractive \
DOTNET_CLI_TELEMETRY_OPTOUT=1
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
ca-certificates \
curl \
gnupg \
dirmngr; \
rm -rf /var/lib/apt/lists/*;
# Register Microsoft package source for .NET SDK
RUN set -eux; \
curl -fsSL https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -o packages-microsoft-prod.deb; \
dpkg -i packages-microsoft-prod.deb; \
rm packages-microsoft-prod.deb; \
apt-get update; \
# Install .NET 10 SDK (preview) - adjust package name if needed by the image
apt-get install -y --no-install-recommends dotnet-sdk-10.0; \
rm -rf /var/lib/apt/lists/*;
# Create work directory and copy source
WORKDIR /src
COPY . ./
# Restore and build the project from source
RUN dotnet restore
RUN dotnet build -c Release
# Expose a shell so the container remains interactive for exploration / tests
CMD ["bash"]
# Ignore git, large build outputs, and local artifacts .git **/bin/ **/obj/ **/artifact*/ **/artifacts/ **/.vs/ node_modules/ .nuget/packages/ .nuget/**/cache/ # Ignore common IDE/editor folders .vscode/ .idea/ # Ignore dotnet publish output and nuget caches **/publish/ **/*_i/*.tmp
- Exact error message and exit code:
- The build failed with:
ERROR: failed to build: failed to solve: process "/bin/sh -c set -eux; curl -fsSL https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -o packages-microsoft-prod.deb; dpkg -i packages-microsoft-prod.deb; rm packages-microsoft-prod.deb; apt-get update; apt-get install -y --no-install-recommends dotnet-sdk-10.0; rm -rf /var/lib/apt/lists/*;" did not complete successfully: exit code: 100
- Failing command/step:
- [3/7] RUN set -eux; curl -fsSL https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -o packages-microsoft-prod.deb; dpkg -i packages-microsoft-prod.deb; rm packages-microsoft-prod.deb; apt-get update; apt-get install -y --no-install-recommends dotnet-sdk-10.0; rm -rf /var/lib/apt/lists/*;
- Missing packages or files mentioned:
- E: Unable to locate package dotnet-sdk-10.0
- E: Couldn't find any package by glob 'dotnet-sdk-10.0'
- This indicates dotnet-sdk-10.0 is not available in the configured repositories.
- Version mismatch / context notes:
- Base image uses Ubuntu jammy (22.04) with the Microsoft package source for ubuntu/22.04.
- Attempted to install dotnet-sdk-10.0 (a preview/older major version) which is not present in the enabled apt sources for this combination. A newer/supported SDK version (e.g., dotnet-sdk-7.0, 6.0, or 11.x) may be required.# Multi-stage build: compile against .NET 10 SDK and run with .NET Runtime 10 # Stage 1: Build the Humanizer project using .NET 10 SDK image FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build WORKDIR /src # Copy the repository contents COPY . ./ # Restore and build the Humanizer project (net10.0 + multi-targets) RUN dotnet restore src/Humanizer/Humanizer.csproj RUN dotnet build -c Release src/Humanizer/Humanizer.csproj # Stage 2: Create a lightweight runtime image embedding the built outputs FROM mcr.microsoft.com/dotnet/runtime:10.0 AS runtime WORKDIR /app # Copy all built outputs from the build stage COPY --from=build /src/src/Humanizer/bin/Release /app/bin # Provide an interactive shell for inspection and usage CMD ["bash"]
FROM ubuntu:jammy-20260217
ENV DEBIAN_FRONTEND=noninteractive
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
ca-certificates \
curl \
gnupg \
dirmngr; \
rm -rf /var/lib/apt/lists/*;
# Microsoft package feed for Ubuntu 22.04 (jammy)
RUN set -eux; \
curl -fsSL https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -o packages-microsoft-prod.deb; \
dpkg -i packages-microsoft-prod.deb; \
rm packages-microsoft-prod.deb; \
apt-get update; \
apt-get install -y --no-install-recommends dotnet-sdk-8.0; \
rm -rf /var/lib/apt/lists/*;
WORKDIR /src
COPY . ./
RUN dotnet restore
RUN dotnet build -c Release -f net8.0
CMD ["bash"]
Summary of Docker build error
- Failing step: [6/7] RUN dotnet restore (Dockerfile:27)
- Exact error message and exit code (as appears in output):
The command could not be loaded, possibly because:
* You intended to execute a .NET application:
The application 'restore' does not exist.
* You intended to execute a .NET SDK command:
A compatible .NET SDK was not found.
Requested SDK version: 10.0.100
8.0.419 [/usr/share/dotnet/sdk]
global.json file: /src/global.json
Installed SDKs:
Install the [10.0.100] .NET SDK or update [/src/global.json] to match an installed SDK.
Learn about SDK resolution:
https://aka.ms/dotnet/sdk-not-found
Exit code: 145
- Missing packages/files mentioned:
- global.json file path: /src/global.json (used to pin the SDK)
- The requested SDK (10.0.100) is not installed; the system only has 8.0.419 at /usr/share/dotnet/sdk
- Version mismatch info:
- Requested SDK version: 10.0.100
- Installed SDK: 8.0.419
- The message indicates a mismatch between global.json requirement and available SDKs
- Context note:
- This occurs during dotnet restore, which relies on the SDK specified in global.json; the absence of 10.0.100 causes the command to fail with exit code 145.FROM ubuntu:jammy-20260217
ENV DEBIAN_FRONTEND=noninteractive
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
ca-certificates \
curl \
gnupg \
dirmngr; \
rm -rf /var/lib/apt/lists/*;
# Microsoft package feed for Ubuntu 22.04 (jammy)
RUN set -eux; \
curl -fsSL https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -o packages-microsoft-prod.deb; \
dpkg -i packages-microsoft-prod.deb; \
rm packages-microsoft-prod.deb; \
apt-get update; \
apt-get install -y --no-install-recommends dotnet-sdk-10.0; \
rm -rf /var/lib/apt/lists/*;
WORKDIR /src
COPY . ./
RUN dotnet restore
RUN dotnet build -c Release
CMD ["bash"]
Error summary: - Failing step (command/step): [3/7] RUN set -eux; curl -fsSL https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -o packages-microsoft-prod.deb; dpkg -i packages-microsoft-prod.deb; rm packages-microsoft-prod.deb; apt-get update; apt-get install -y --no-install-recommends dotnet-sdk-10.0; rm -rf /var/lib/apt/lists/*; - Exact error messages and exit code: exit code: 100 E: Unable to locate package dotnet-sdk-10.0 E: Couldn't find any package by glob 'dotnet-sdk-10.0' E: Couldn't find any package by regex 'dotnet-sdk-10.0' - Missing packages or files mentioned: - dotnet-sdk-10.0 could not be located in the configured apt sources after adding the Microsoft package feed. - Version mismatch / context: - The Dockerfile adds the Microsoft Ubuntu 22.04 (jammy) package feed and attempts to install dotnet-sdk-10.0, but that package is not available for jammy in the configured sources. Use a supported SDK version (e.g., a currently published dotnet-sdk version such as 6.0/7.0/8.0, depending on needs) or adjust to a version present in the repository.
##############################
# Multi-stage build for Humanizer library
# Stage 1: Build with .NET 8 SDK on Ubuntu 22.04
##############################
FROM ubuntu:22.04 AS build
ENV DEBIAN_FRONTEND=noninteractive
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
ca-certificates \
curl \
gnupg \
dirmngr; \
rm -rf /var/lib/apt/lists/*;
# Microsoft package feed for Ubuntu 22.04 (jammy)
RUN set -eux; \
curl -fsSL https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -o packages-microsoft-prod.deb; \
dpkg -i packages-microsoft-prod.deb; \
rm packages-microsoft-prod.deb; \
apt-get update; \
apt-get install -y --no-install-recommends dotnet-sdk-8.0; \
rm -rf /var/lib/apt/lists/*;
WORKDIR /src
# Copy the repository contents
COPY . ./
# Override global.json to use a supported SDK (net8.0)
RUN if [ -f global.json ]; then cp global.json global.json.bak; fi; \
printf '{\n "sdk": {"version": "8.0.100", "rollForward": "latestFeature"}\n}\n' > global.json
RUN dotnet restore
RUN dotnet build -c Release -f net8.0
##############################
# Stage 2: Runtime image (smaller)
##############################
FROM mcr.microsoft.com/dotnet/runtime:8.0 AS runtime
WORKDIR /app
# Copy built outputs
COPY --from=build /src/Humanizer/bin/Release/net8.0 /app
# Restore original global.json if we replaced it and keep container interactive
# (No entrypoint to run as a library; provide a shell for inspection)
CMD ["bash"]
##############################
# Multi-stage build for Humanizer library
# Stage 1: Build with .NET 8 SDK on Ubuntu 22.04
##############################
FROM ubuntu:22.04 AS build
ENV DEBIAN_FRONTEND=noninteractive
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
ca-certificates \
curl \
gnupg \
dirmngr; \
rm -rf /var/lib/apt/lists/*;
# Microsoft package feed for Ubuntu 22.04 (jammy)
RUN set -eux; \
curl -fsSL https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -o packages-microsoft-prod.deb; \
dpkg -i packages-microsoft-prod.deb; \
rm packages-microsoft-prod.deb; \
apt-get update; \
apt-get install -y --no-install-recommends dotnet-sdk-8.0; \
rm -rf /var/lib/apt/lists/*;
WORKDIR /src
# Copy the repository contents
COPY . ./
# Override global.json to use a supported SDK (net8.0)
RUN if [ -f global.json ]; then cp global.json global.json.bak; fi; \
printf '{\n "sdk": {"version": "8.0.100", "rollForward": "latestFeature"}\n}\n' > global.json
RUN dotnet restore
RUN dotnet build -c Release -f net8.0
##############################
# Stage 2: Runtime image (smaller)
##############################
FROM ubuntu:22.04 AS runtime
WORKDIR /app
# Copy built outputs from the build stage (net8.0)
COPY --from=build /src/bin/Release/net8.0 /app
# Provide a shell for testing
CMD ["bash"]
Summary (under 1500 chars): - Exact error message and exit code - MSBUILD : error MSB1003: Specify a project or solution file. The current working directory does not contain a project or solution file. - Exit code: 1 - Failing command/step - [build 7/8] RUN dotnet restore - Missing packages or files mentioned - The restore fails because the current working directory /src does not contain a project or solution file (no .csproj/.fsproj/.vbproj or .sln found). - Version mismatch info - Dockerfile sets global.json with sdk version 8.0.100 and rollForward: latestFeature. - The actual .NET SDK installed is 8.0.419 (SDK Version: 8.0.419) and dotnet restore runs against that SDK. - This is consistent with the rollForward setting, but indicates a mismatch between requested (8.0.100) and installed (8.0.419) versions.
Error: file not found: README.md
Summary: - Humanizer is a .NET library for transforming and displaying strings, enums, dates/times, timespans, numbers, and quantities in a human-friendly form. Packages: Humanizer (all languages) and Humanizer.Core (English only); language-specific packs like Humanizer.Core.fr, .es, etc. - Install options: - All languages: dotnet add package Humanizer - English only: dotnet add package Humanizer.Core - Specific languages: dotnet add package Humanizer.Core.<locale> (e.g., fr, es) - Framework targets: - Supported: net10.0, net8.0, net48 - netstandard2.0 is supported as a special case for Roslyn/MSBuild tasks - Not officially supported: net4.6.1–net4.7.2 (though may work) - 3.0 restore requirement: - Restore requires .NET SDK 9.0.200+ or VS/MSBuild with that patch - If using older tooling, reference Humanizer.Core and add satellite packages manually - Migration notes: docs/migration-v3.md - Key capabilities (highlights): - Strings: Humanize, Dehumanize, Transform, Truncate - Enums: Humanize (with Description/DisplayAttribute precedence), DehumanizeTo - DateTime/DateTimeOffset: Humanize with culture, relative terms, precision strategies (PrecisionDateTimeHumanizeStrategy) - TimeSpan: Humanize with precision, minUnit/maxUnit, toWords, collectionSeparator, zero handling - Fluent Date, Number-to-words/ordinal, Inflector (Pluralize/Singularize/ToQuantity/ToWords/ToOrdinalWords), and various case converters (Titleize/Pascalize/Camelize/Underscore/Dasherize/Kebaberize) - ByteSize: conversion, parsing (Parse/TryParse), formatting, and Humanize with various units - Time units: ToSymbol, heading/clock notation, and related utilities - ASP.NET MVC integration (sample): - HumanizerMetadataProvider auto-humanizes property names when no DisplayName/Display attributes exist - Register via: ModelMetadataProviders.Current = new HumanizerMetadataProvider(); - Example shows replacing explicit Display attributes with automatic humanized labels - Additional notes: - There are extensive docs and migration guidance; see docs/migration-v3.md - For practical usage, see code samples and the various public API methods described above - The library also offers collections formatting, age representation (ToAge), and multiple localization options
##############################
# Multi-stage build for Humanizer library
# Stage 1: Build with .NET 8 SDK on Ubuntu 22.04
##############################
FROM ubuntu:22.04 AS build
ENV DEBIAN_FRONTEND=noninteractive
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
ca-certificates \
curl \
gnupg \
dirmngr; \
rm -rf /var/lib/apt/lists/*;
# Microsoft package feed for Ubuntu 22.04 (jammy)
RUN set -eux; \
curl -fsSL https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -o packages-microsoft-prod.deb; \
dpkg -i packages-microsoft-prod.deb; \
rm packages-microsoft-prod.deb; \
apt-get update; \
apt-get install -y --no-install-recommends dotnet-sdk-8.0; \
rm -rf /var/lib/apt/lists/*;
WORKDIR /src
# Copy the repository contents
COPY . ./
# Restore and build the Humanizer project (net8.0)
RUN dotnet restore src/Humanizer/Humanizer.csproj
RUN dotnet build -c Release -f net8.0 src/Humanizer/Humanizer.csproj
##############################
# Stage 2: Runtime image (smaller)
##############################
FROM ubuntu:22.04 AS runtime
WORKDIR /app
# Copy built outputs from the build stage (net8.0)
COPY --from=build /src/src/Humanizer/bin/Release/net8.0 /app
# Provide a shell for testing
CMD ["bash"]
Summary (under 1500 chars):
- Failing step: [build 6/7] RUN dotnet restore src/Humanizer/Humanizer.csproj
- Exit code: 145
- Exact error output:
The command could not be loaded, possibly because:
* You intended to execute a .NET application:
The application 'restore' does not exist.
* You intended to execute a .NET SDK command:
A compatible .NET SDK was not found.
Requested SDK version: 10.0.100
global.json file: /src/global.json
8.0.419 [/usr/share/dotnet/sdk]
Installed SDKs:
Install the [10.0.100] .NET SDK or update [/src/global.json] to match an installed SDK.
Learn about SDK resolution:
https://aka.ms/dotnet/sdk-not-found
- Final build error line:
ERROR: failed to build: failed to solve: process "/bin/sh -c dotnet restore src/Humanizer/Humanizer.csproj" did not complete successfully: exit code: 145
- Missing packages/files mentioned:
- global.json at /src/global.json requests SDK version 10.0.100
- Only 8.0.419 is installed at /usr/share/dotnet/sdk
- The project being restored: src/Humanizer/Humanizer.csproj
- Version mismatch info:
- Requested SDK version: 10.0.100
- Installed SDKs: 8.0.419
- Message indicates no compatible .NET SDK found to satisfy global.json 10.0.100
- Context:
- The error arises during attempting to restore the Humanizer project (src/Humanizer/Humanizer.csproj) in the Dockerfile step [build 6/7].##############################
# Multi-stage build for Humanizer library
# Stage 1: Build with .NET 8 SDK on Ubuntu 22.04
##############################
FROM ubuntu:22.04 AS build
ENV DEBIAN_FRONTEND=noninteractive
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
ca-certificates \
curl \
gnupg \
dirmngr; \
rm -rf /var/lib/apt/lists/*;
# Microsoft package feed for Ubuntu 22.04 (jammy)
RUN set -eux; \
curl -fsSL https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -o packages-microsoft-prod.deb; \
dpkg -i packages-microsoft-prod.deb; \
rm packages-microsoft-prod.deb; \
apt-get update; \
apt-get install -y --no-install-recommends dotnet-sdk-8.0; \
rm -rf /var/lib/apt/lists/*;
WORKDIR /src
# Copy the repository contents
COPY . ./
# Ensure no pinned SDK in the repo interferes with build
RUN rm -f global.json || true
# Restore and build the Humanizer project (net8.0)
RUN dotnet restore src/Humanizer/Humanizer.csproj
RUN dotnet build -c Release -f net8.0 src/Humanizer/Humanizer.csproj
##############################
# Stage 2: Runtime image (smaller)
##############################
FROM ubuntu:22.04 AS runtime
WORKDIR /app
# Copy built outputs from the build stage (net8.0)
COPY --from=build /src/src/Humanizer/bin/Release/net8.0 /app
# Provide a shell for testing
CMD ["bash"]
Failing step - [build 7/8] RUN dotnet restore src/Humanizer/Humanizer.csproj Exact error message and exit code - NETSDK1045: The current .NET SDK does not support targeting .NET 10.0. Either target .NET 8.0 or lower, or use a version of the .NET SDK that supports .NET 10.0. Download the .NET SDK from https://aka.ms/dotnet/download [/src/src/Humanizer/Humanizer.csproj::TargetFramework=net10.0] - ERROR: process "/bin/sh -c dotnet restore src/Humanizer/Humanizer.csproj" did not complete successfully: exit code: 1 - Exit code: 1 Missing packages or files mentioned - None explicitly mentioned. Issue is a version/framework mismatch (net10.0 target with SDK that doesn’t support it). Version mismatch info - SDK Version: 8.0.419 (the .NET SDK being used) - Project targets net10.0 (as indicated by the error path [/src/src/Humanizer/Humanizer.csproj::TargetFramework=net10.0]) - The log states to either target NET8.0 or install a newer SDK that supports NET10.0.
##############################
# Multi-stage build using Ubuntu with dotnet-install for .NET 10.0 preview
# Stage 1: Build with .NET 10.0 (preview) SDK on Ubuntu 22.04
##############################
FROM ubuntu:22.04 AS build
ENV DEBIAN_FRONTEND=noninteractive
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
ca-certificates \
curl \
gnupg \
dirmngr \
ca-certificates; \
rm -rf /var/lib/apt/lists/*;
# Install .NET 10.0 SDK via dotnet-install script (preview)
RUN curl -sSL https://dot.net/v1/dotnet-install.sh -o /tmp/dotnet-install.sh; \
chmod +x /tmp/dotnet-install.sh; \
/tmp/dotnet-install.sh --version 10.0.100 --install-dir /usr/share/dotnet --no-path;
ENV PATH=/usr/share/dotnet:$PATH
WORKDIR /src
# Copy the repository contents
COPY . ./
# Ensure no pinned SDK in the repo interferes with build
RUN rm -f global.json || true
# Restore and build the Humanizer project (net8.0 target among others)
RUN dotnet restore src/Humanizer/Humanizer.csproj
RUN dotnet build -c Release -f net8.0 src/Humanizer/Humanizer.csproj
##############################
# Stage 2: Runtime image (smaller) with .NET 10.0 runtime installed
##############################
FROM ubuntu:22.04 AS runtime
ENV DEBIAN_FRONTEND=noninteractive
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
ca-certificates \
curl; \
rm -rf /var/lib/apt/lists/*;
# Install .NET 10.0 Runtime via dotnet-install script
COPY --from=build /usr/share/dotnet /usr/share/dotnet
RUN ln -s /usr/share/dotnet/dotnet /usr/local/bin/dotnet || true
ENV DOTNET_ROOT=/usr/share/dotnet
ENV PATH=/usr/share/dotnet:$PATH
WORKDIR /app
# Copy built outputs from the build stage (net8.0 build artifacts included as part of net8.0 outputs)
COPY --from=build /src/Humanizer/bin/Release/net8.0 /app
# Provide a shell for testing
CMD ["bash"]
Actionable summary: - Status: VerifyBuild status: build_failed. Project is a library (no runnable executable); runtime image includes DLLs but no entrypoint. - Build step and command: - [build 7/8] RUN dotnet restore src/Humanizer/Humanizer.csproj - Exact error (exit code 134): - ERROR: process "/bin/sh -c dotnet restore src/Humanizer/Humanizer.csproj" did not complete successfully: exit code: 134 - Couldn’t find a valid ICU package installed on the system. Please install libicu (or icu-libs) using your package manager and try again. Alternatively you can set the configuration flag System.Globalization.Invariant to true if you want to run with no globalization support. Please see https://aka.ms/dotnet-missing-libicu for more information. - Aborted (core dumped) - Missing packages/files: - ICU package missing: libicu (or icu-libs) - Version/context: - Dotnet SDK: 10.0.100 (installed as per dotnet-install) - Dockerfile targets net8.0 (restore/build for net8.0 with a 10.x SDK). This is not a version mismatch; the failure is due to missing ICU. - Ancillary note: - Apt-get install line redundantly lists ca-certificates twice (minor inefficiency). Recommended actions: - Install ICU packages for your distro (e.g., libicu or icu-libs) and re-run the build. - If ICU cannot be installed, you can set System.Globalization.Invariant to true to skip globalization support (per linked guidance).
##############################
# Multi-stage build for Humanizer library using .NET 10 preview
# Stage 1: Build with .NET 10 preview SDK on Ubuntu 22.04
##############################
FROM ubuntu:22.04 AS build
ENV DEBIAN_FRONTEND=noninteractive
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
ca-certificates \
curl \
gnupg \
dirmngr; \
rm -rf /var/lib/apt/lists/*;
# Install .NET 10.0 preview SDK via dotnet-install script
RUN curl -sSL https://dot.net/v1/dotnet-install.sh -o /tmp/dotnet-install.sh; \
chmod +x /tmp/dotnet-install.sh; \
/tmp/dotnet-install.sh --version 10.0.100 --install-dir /usr/share/dotnet --no-path;
ENV DOTNET_ROOT=/usr/share/dotnet
ENV PATH=${DOTNET_ROOT}:$PATH
# Enable globalization invariant mode to avoid ICU requirements in some environments
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=true
WORKDIR /src
# Copy the repository contents
COPY . ./
# Avoid pinned global.json in the repository interfering with SDK selection
RUN rm -f global.json || true
# Restore and build the Humanizer project (net10.0)
RUN dotnet restore
RUN dotnet build -c Release -f net10.0 src/Humanizer/Humanizer.csproj
##############################
# Stage 2: Runtime image (smaller)
##############################
FROM ubuntu:22.04 AS runtime
WORKDIR /app
# Copy built outputs from the build stage (net10.0)
COPY --from=build /src/bin/Release/net10.0 /app
# Provide a shell for testing
CMD ["bash"]
Summary: - Exact error message and exit code - ERROR: failed to calculate checksum of ref dm0crafjnw8l43ifl6uhde0ck::q8ys5mo07xfie66getlojymiu: "/src/bin/Release/net10.0": not found - Exit code: 1 (non-zero, general Docker build error) - Failing command/step - [runtime 3/3] COPY --from=build /src/bin/Release/net10.0 /app - Dockerfile:45 - Missing packages or files mentioned - Missing file: /src/bin/Release/net10.0 - Context: The build produced binaries under /src/src/Humanizer/bin/Release/net10.0 (e.g., Humanizer.dll), not under /src/bin/Release/net10.0, which the COPY attempts to use. - Version mismatch / other version info - dotnet install: Installed version is 10.0.100 (SDK Version: 10.0 as shown during restore/build) - Actual built outputs location: /src/src/Humanizer/bin/Release/net10.0 (observed in build logs) - The COPY path (/src/bin/Release/net10.0) does not exist; the artifacts are under /src/src/Humanizer/bin/Release/net10.0, indicating a path mismatch rather than a software version mismatch. Notes: - The build itself completed successfully up to the copy step; the failure is caused by attempting to copy from a non-existent path. - To fix, align the COPY source with where dotnet build actually places artifacts (e.g., /src/src/Humanizer/bin/Release/net10.0) or adjust the build output directory in the Dockerfile.
##############################
# Multi-stage build for Humanizer library using .NET 10 preview
# Stage 1: Build with .NET 10 preview SDK on Ubuntu 22.04
##############################
FROM ubuntu:22.04 AS build
ENV DEBIAN_FRONTEND=noninteractive
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
ca-certificates \
curl \
gnupg \
dirmngr; \
rm -rf /var/lib/apt/lists/*;
# Install .NET 10.0 preview SDK via dotnet-install script
RUN curl -sSL https://dot.net/v1/dotnet-install.sh -o /tmp/dotnet-install.sh; \
chmod +x /tmp/dotnet-install.sh; \
/tmp/dotnet-install.sh --version 10.0.100 --install-dir /usr/share/dotnet --no-path;
ENV DOTNET_ROOT=/usr/share/dotnet
ENV PATH=${DOTNET_ROOT}:$PATH
# Enable globalization invariant mode to avoid ICU requirements in some environments
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=true
WORKDIR /src
# Copy the repository contents
COPY . ./
# Avoid pinned global.json in the repository interfering with SDK selection
RUN rm -f global.json || true
# Restore and build the Humanizer project (net10.0)
RUN dotnet restore
RUN dotnet build -c Release -f net10.0 src/Humanizer/Humanizer.csproj
##############################
# Stage 2: Runtime image (smaller)
##############################
FROM ubuntu:22.04 AS runtime
WORKDIR /app
# Copy built outputs from the build stage (net10.0)
COPY --from=build /src/src/Humanizer/bin/Release/net10.0 /app
# Provide a shell for testing
CMD ["bash"]
Concerns: Runtime image does not install a .NET runtime, so the container cannot execute the library directly. This is acceptable for a library artifact, but smoke tests should focus on the presence of output artifacts (e.g., DLLs) or add a test harness if runtime execution is desired., Using a .NET 10 preview SDK in the build stage can be brittle in CI environments if the preview tooling is not consistently available or supported; consider pinning to a supported preview or using a stable target if feasible., The final image uses a bare shell CMD (bash). For automated smoke testing, it’s better to have at least a lightweight verification path (e.g., presence of DLL) or an explicit test harness rather than relying solely on an interactive shell. Smoke [PASS]: test -f /app/Humanizer.dll Smoke [PASS]: ls -la /app | grep -i Humanizer.dll || true Smoke [PASS]: ls -la /app | head -n 5