# Dockerfile for Bogus repository
FROM ubuntu:jammy-20260217
# Install dependencies and .NET SDK 8.0 (via Microsoft feeds) and a compatible SDK via dotnet-install for SDK 10.x as per global.json
ENV DEBIAN_FRONTEND=noninteractive
# Core system deps
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates curl apt-transport-https gnupg wget \
&& rm -rf /var/lib/apt/lists/*
# Install the Microsoft package repository and SDKs
RUN wget https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb && \
dpkg -i packages-microsoft-prod.deb && \
rm -f packages-microsoft-prod.deb && \
apt-get update && \
apt-get install -y --no-install-recommends dotnet-sdk-8.0 && \
rm -rf /var/lib/apt/lists/*
# Additionally install the .NET 10.x SDK via the official install script to honor global.json (10.0.100)
RUN curl -sSL https://dot.net/v1/dotnet-install.sh -o dotnet-install.sh && \
chmod +x dotnet-install.sh && \
./dotnet-install.sh -Channel 10.0 -Version 10.0.100 -InstallDir /usr/share/dotnet-10 && \
# Use only the 10.x dotnet by placing it in PATH; avoid clobbering existing /usr/bin/dotnet
export DOTNET_10=/usr/share/dotnet-10/dotnet && \
ln -s /usr/share/dotnet-10/dotnet /usr/bin/dotnet-10 && \
chmod +x /usr/bin/dotnet-10
# Ensure dotnet 10.x is available at dotnet-10 wrapper
ENV PATH=/usr/share/dotnet-10:$PATH
WORKDIR /src
# Copy the entire repository into the image
COPY . .
# Build Bogus from source, restore and build the solution (avoid forcing net6.0 to support all projects)
RUN dotnet restore Source/Bogus.sln
RUN dotnet build Source/Bogus.sln -c Release
# Default command to keep the container interactive for usage
CMD ["/bin/bash"]