From a6a0889090ebcb93519393ea9fc13d48b8518bcb Mon Sep 17 00:00:00 2001 From: Mitch Denny Date: Sat, 1 Nov 2025 21:25:37 +1100 Subject: [PATCH 1/2] Fix golang and alpine images. --- .../withdockerfile/WithDockerfile.AppHost/Program.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/playground/withdockerfile/WithDockerfile.AppHost/Program.cs b/playground/withdockerfile/WithDockerfile.AppHost/Program.cs index 89359eb2a38..070c65ef605 100644 --- a/playground/withdockerfile/WithDockerfile.AppHost/Program.cs +++ b/playground/withdockerfile/WithDockerfile.AppHost/Program.cs @@ -22,13 +22,13 @@ { var timestamp = DateTime.Now.ToString("yyyyMMddHHmmss", System.Globalization.CultureInfo.InvariantCulture); return $""" - FROM golang:1.22-alpine AS builder + FROM mcr.microsoft.com/oss/go/microsoft/golang:1.23 AS builder WORKDIR /app COPY . . RUN echo "Built at {timestamp}" > /build-info.txt RUN go build -o qots . - FROM alpine:latest + FROM mcr.microsoft.com/cbl-mariner/base/core:2.0 COPY --from=builder /app/qots /qots COPY --from=builder /build-info.txt /build-info.txt ENTRYPOINT ["/qots"] @@ -41,14 +41,14 @@ ENTRYPOINT ["/qots"] { // Simulate reading from a template or external source await Task.Delay(1, context.CancellationToken); - var baseImage = Environment.GetEnvironmentVariable("BASE_IMAGE") ?? "golang:1.22-alpine"; + var baseImage = Environment.GetEnvironmentVariable("BASE_IMAGE") ?? "mcr.microsoft.com/oss/go/microsoft/golang:1.23"; return $""" FROM {baseImage} AS builder WORKDIR /app COPY . . RUN go build -o qots . - FROM alpine:latest + FROM mcr.microsoft.com/cbl-mariner/base/core:2.0 COPY --from=builder /app/qots /qots ENTRYPOINT ["/qots"] """; From 5a921a754fcc54d91266719d4a3bfff163b0c149 Mon Sep 17 00:00:00 2001 From: Mitch Denny Date: Sat, 1 Nov 2025 21:43:43 +1100 Subject: [PATCH 2/2] More changes. --- playground/withdockerfile/WithDockerfile.AppHost/Program.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/playground/withdockerfile/WithDockerfile.AppHost/Program.cs b/playground/withdockerfile/WithDockerfile.AppHost/Program.cs index 070c65ef605..9b62ee945d6 100644 --- a/playground/withdockerfile/WithDockerfile.AppHost/Program.cs +++ b/playground/withdockerfile/WithDockerfile.AppHost/Program.cs @@ -55,6 +55,7 @@ ENTRYPOINT ["/qots"] }); builder.AddRedis("builder-sync") + .WithImageRegistry("netaspireci.azurecr.io") .WithDockerfileBuilder(".", context => { if (!context.Resource.TryGetContainerImageName(useBuiltImage: false, out var imageName)) @@ -66,6 +67,7 @@ ENTRYPOINT ["/qots"] }); builder.AddRedis("builder-async") + .WithImageRegistry("netaspireci.azurecr.io") .WithDockerfileBuilder(".", async context => { await Task.Delay(1, context.CancellationToken);