Skip to content

Update images to unify usage of ENTRYPOINT and CMD #270

Description

@julienp

Our images set CMD ["pulumi"], except the kitchen sink, which sets ENTRYPOINT ["pulumi"].

CMD sets the arguments that are passed to the ENTRYPOINT. The default entrypoint is usually bash -c.

The README says (outdated, obviously):

In order to try and keep the images flexible and try to meet as many use cases as possible, none of these images have CMD or entrypoint set, so you'll need to specify the commands you want to run, for example:

docker run -e PULUMI_ACCESS_TOKEN=<TOKEN> -v "$(pwd)":/pulumi/projects $IMG /bin/bash -c "npm ci && pulumi preview -s <stackname>"

The base image for Python sets CMD ["python"], overriding that to CMD ["pulumi"] makes some sense, if you docker run with no other arguments, it prints the pulumi CLI help, rather than starting a python interpreter.

Setting the entrypoint to pulumi means when you run docker run $IMG version and it will essentially run pulumi version. At first glance, that seems useful, for example you just pass up to run an update, but in practice you might need to run pulumi install first. Now you're forced to override the entrypoint: docker run --entrypoint bash pulumi/pulumi -c "pulumi install && pulumi up --yes" (note that awkward arguments -c "...").

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions