Skip to content

ContainerDefaultArgs generate duplicate Cmd entries #644

@FrankyBoy

Description

@FrankyBoy

In csproj:

  <ItemGroup>
    <ContainerDefaultArgs Include="arg1" />
    <ContainerDefaultArgs Include="arg2" />
  </ItemGroup>

Build target:

publish:
  stage: publish
  image: mcr.microsoft.com/dotnet/sdk:9.0
  script:
    - dotnet publish /t:PublishContainer

Build output (redacted).

$ dotnet publish /t:PublishContainer
  Determining projects to restore...
  Restored /builds/[path_to_proj]/myproj.csproj (in 4.63 sec).
  myproj -> /builds/[path_to_proj]/bin/Release/net9.0/myproj.dll
  myproj -> /builds/[path_to_proj]/bin/Release/net9.0/publish/
  myproj -> /builds/[path_to_proj]/bin/Release/net9.0/linux-x64/myproj.dll
  myproj -> /builds/[path_to_proj]/bin/Release/net9.0/linux-x64/publish/
  Building image '[imgname]' with tags 'latest-linux-x64' on top of base image 'mcr.microsoft.com/dotnet/runtime:9.0'.
  [uploading]

podman inspect

[...]
"Entrypoint": [
    "dotnet",
    "/app/myproj.dll"
],
"Cmd": [
    "arg1",
    "arg2",
    "arg1",
    "arg2"
],
[...]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions