Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update images to unify usage of ENTRYPOINT and CMD #270

Open
julienp opened this issue Sep 6, 2024 · 1 comment
Open

Update images to unify usage of ENTRYPOINT and CMD #270

julienp opened this issue Sep 6, 2024 · 1 comment
Assignees
Labels
kind/enhancement Improvements or new features

Comments

@julienp
Copy link
Contributor

julienp commented Sep 6, 2024

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 "...").

@pulumi-bot pulumi-bot added the needs-triage Needs attention from the triage team label Sep 6, 2024
@julienp julienp added kind/enhancement Improvements or new features and removed needs-triage Needs attention from the triage team labels Sep 6, 2024
@julienp julienp self-assigned this Sep 6, 2024
@julienp
Copy link
Contributor Author

julienp commented Sep 6, 2024

Thinking some more about this, we can't change this without breaking backwards compatibility.

@julienp julienp changed the title Update images to use pulumi as entrypoint, not command Update images to unify usage of ENTRYPOINT and CMD Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Improvements or new features
Projects
None yet
Development

No branches or pull requests

2 participants