Use trimmed azmcp for Docker (#423)

* Use trimmed azmcp for Docker

* revert to original mcr image
This commit is contained in:
Anu Thomas authored and GitHub committed 2025-09-12 12:29:11 -07:00
1 parent 834b6fc9c0
commit e3cee2541b
2 files changed
+10 -7

No files matched your search

+7 -5
View File
@@ -9,14 +9,16 @@ RUN if [ -z "$PUBLISH_DIR" ]; then \
echo "ERROR: PUBLISH_DIR build argument is required" && exit 1; \
fi
# Copy the contents of the publish directory
COPY ${PUBLISH_DIR} .
# Copy the contents of the publish directory to '/azuremcpserver' and set it as the working directory
RUN mkdir -p /azuremcpserver
COPY ${PUBLISH_DIR} /azuremcpserver/
WORKDIR /azuremcpserver
# List the contents of the current directory
RUN ls -la
RUN if [ ! -f "azmcp.dll" ]; then \
echo "ERROR: azmcp 'azmcp.dll' does not exist" && exit 1; \
RUN if [ ! -f "azmcp" ]; then \
echo "ERROR: azmcp executable does not exist" && exit 1; \
fi
ENTRYPOINT ["dotnet", "azmcp.dll", "server", "start"]
ENTRYPOINT ["./azmcp", "server", "start"]
+3 -2
View File
@@ -23,11 +23,12 @@ if(!$Version) {
# Will fix this when we update Dockerfile to multi-platform
$os = "linux"
$arch = "x64"
$SingleFile = $Trimmed
$tag = "$dockerImageName`:$Version$VersionSuffix";
& "$root/eng/scripts/Build-Module.ps1" -ServerName $ServerName -VersionSuffix $VersionSuffix -SelfContained -Trimmed:$Trimmed -DebugBuild:$DebugBuild -OperatingSystem $os -Architecture $arch
& "$root/eng/scripts/Build-Module.ps1" -ServerName $ServerName -VersionSuffix $VersionSuffix -SelfContained -Trimmed:$Trimmed -SingleFile:$SingleFile -DebugBuild:$DebugBuild -OperatingSystem $os -Architecture $arch
[string]$publishDirectory = $([System.IO.Path]::Combine($distPath, "$os-$arch", "dist"))
[string]$publishDirectory = $([System.IO.Path]::Combine($distPath, "build", $ServerName, "$os-$arch", "dist"))
$relativeDirectory = $(Resolve-Path $publishDirectory -Relative).Replace('\', '/')
Write-Host "Building Docker image ($tag). PATH: [$relativeDirectory]. Absolute: [$publishDirectory]."