Skip to content

crane mutate deletes Cmd if you try to override the --entrypoint without --cmd #2041

Open
@cormacrelf

Description

@cormacrelf

Describe the bug

Given a base image with Entrypoint + Cmd;

crane mutate --entrypoint ... without also specifying --cmd deletes the Cmd. You end up with an Entrypoint only.

To Reproduce

As above

Expected behavior

Expected it to preserve the original Cmd, and override the Entrypoint only.

Deleting Cmd is unexpected, Dockerfile syntax ENTRYPOINT [...] does not do that. Ultimately to use crane mutate, you have to look up the base image, get .Config.Cmd, and re-add it as --cmd if you are using --entrypoint alone. This is possible! But not expected behaviour

Additional context

Add any other context about the problem here.

  • Output of crane version: 0.19.1, but there are no relevant commits since then.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions