Files
mcp-microsoft/Dockerfile
T
Connie Yau d40653100d Fix Dockerfile (#152)
* Fix docker file for AOT

* Update docker instructions
2025-05-10 02:51:31 -07:00

28 lines
815 B
Docker

# Use the official .NET SDK image as the build image
FROM mcr.microsoft.com/dotnet/sdk:9.0.102-bookworm-slim AS build
WORKDIR /src
COPY . .
# Publish the application
FROM build AS publish
RUN pwsh "eng/scripts/Build-Module.ps1" -OutputPath /app/publish -OperatingSystem Linux -Architecture x64
# Build the runtime image
FROM mcr.microsoft.com/dotnet/aspnet:9.0-bookworm-slim AS runtime
WORKDIR /app
# Install Azure CLI and required dependencies
RUN apt-get update && apt-get install -y \
curl \
ca-certificates \
apt-transport-https \
lsb-release \
gnupg \
&& curl -sL https://aka.ms/InstallAzureCLIDeb | bash \
&& rm -rf /var/lib/apt/lists/*
# Copy the published application
COPY --from=publish "/app/publish/linux-x64/dist" .
ENTRYPOINT ["dotnet", "azmcp.dll", "server", "start"]