Skip to content

CLI7 overrides Dockerfile BEAM_DOTNET_VERSION ARG #4532

@zpatekar

Description

@zpatekar

Describe the Bug

Change in the MS build command overrides Dockerfile ARG BEAM_DOTNET_VERSION.
Arguments passed in with --build-arg will override default definitions in the Dockerfile, they are used only if not present in the --build-arg.
This results in the inability to use any other base image for the MS.

To Reproduce

Steps to reproduce the behavior:

  1. Create new CLI 7 project
  2. Create new MS
  3. Change ARG BEAM_DOTNET_VERSION in the Dockerfile to 10.0-noble
  4. After FROM mcr.microsoft.com/dotnet/runtime:${BEAM_DOTNET_VERSION} add:
    • RUN apt-get update && apt-get install -y git (arbitrary noble command)
  5. Run dotnet beam deploy plan

Expected Behavior

dotnet beam deploy plan should execute successfully with 10.0-noble base image.

Actual Behavior

dotnet beam deploy plan fails because it uses hard-coded 10.0-alpine base image.

Screenshots

Failed to build service=[GfxService]
starting docker build...
[internal] load build definition from Dockerfile
transferring dockerfile:
[internal] load metadata for mcr.microsoft.com/dotnet/runtime:10.0-alpine
[internal] load .dockerignore
transferring context:
[1/6] FROM mcr.microsoft.com/dotnet/runtime:10.0-alpine@sha256:df50bf8048e1d38c9b9d757eeeac29ce966f9df5f4bd394452189673928ad640
[internal] load build context
resolve mcr.microsoft.com/dotnet/runtime:10.0-alpine@sha256:df50bf8048e1d38c9b9d757eeeac29ce966f9df5f4bd394452189673928ad640
[2/6] RUN apt-get update && apt-get install -y git
/bin/sh: apt-get: not found

[failed] process "/bin/sh -c apt-get update && apt-get install -y git" did not complete successfully: exit code: 127

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions