Skip to content

Generate CMD when ContainerDefaultArgs is not set #643

@FrankyBoy

Description

@FrankyBoy

Hi,

I am trying to build a container from a project which requires command line args for some actions, but not by default. I.e. running myapp is as valid as running myapp arg1234.

Currently there seems to be no way to properly containerize this through dotnet publish.

  • If you do not set any ContainerDefaultArgs, no CMD entry is generated in the container, so docker run mycontainer arg1234 does not pass on the arg1234, or
  • If you do add ContainerDefaultArgs with some other value (as Include is mandatory), you can't run the program without any args (as that would result in the default args being used).

An option of course would be to change the program to requiring an argument for the default behaviour, but that seems like a workaround to me for a problem that should not exist in the first place.

Cheers.

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