-
Notifications
You must be signed in to change notification settings - Fork 292
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
With pack build --run-image
the user specified run image should have precedence over run images provided by extensions
#2091
Comments
The use case I have in mind is, that the builder maintainer - likely in collaboration with buildpack maintainers - could have optimised run images for particular use cases:
In all those cases, I would like to allow the user to know even better. Whatever the specific application might need, the developer should have the last say in providing it. I realise that there are different use cases from that. First and foremost, extending a user provided run image (via What I am not so sure is, whether there is a case to forbid the user to override the dynamic selection of a run image. Even for the Red Hat UBI work, while it might not make sense to override, users might still want or even have to in exceptional cases. In short, maybe the two cases are
One option could be that the extension is responsible to handle it, then we would just need to make it transparent to the extension that the user has specified the run image that got passed in. Maybe we need to expand this and pass in the source of a run image more generally (could be user, builder or another extension and in case of extension it could be a replacement or an *extension). |
I wonder what the UX should be. Maybe
Obviously in the non-extension flow - the conclusion is pretty obvious. Maybe something like this could verify either exact run-image or lineage of the resulting app image? |
Well, all |
I was thinking it could be a verify-lineage sort of thing. The run image's layers must exist on the produced app image but it doesn't have to be the exact run image. |
Understood. Still, the builder / extension maintainer has to decide if an image get's replaced or not and the user can only say if changing the image entirely is acceptable or not. An extension couldn't provide a default run image but accept that the user has the final word. |
Hmm.. multiple scenarios here.. I'd agree the current flag is unclear and would need careful interpretation.
Hmm.. I like the map thing =) |
I think this one could benefit from some synchronous discussion - put it in future topics for Working Group 🙂 |
Agreed @natalieparellano. Although I would also say that this will benefit hugely, if we enforce an asynchronous discussion. An asynchronous discussion more likely will result in the status quo, the different use case and what would need to be changed to balance requirements to be properly documented ;) Would "Build & Run Image Selection" be a good separate chapter for the spec maybe? That one could list and plot the different sources of image changes (dynamic selection and extension)... Just a thought though, because a PR doing this could be the optimal place to have the discussion and pour the discussion results directly into documentation. |
I tend to agree, it is really hard to determine how the run image is selected by reading the spec. We discussed this in Working Group today (3/28), we think the current behavior ( |
Summary
If I call
pack build --run-image my-run-image
, but an extension changes the run image via the following Dockerfile, the application image base layers are taken fromtheir-run-image
.FROM their-run-image
I haven't really tried this, but this is the expectation based on a Slack thread with @natalieparellano
Reproduction
Steps
pack build --run-image my-run-image
using that builderCurrent behavior
The extension provided run image is taken as base for the application image.
Expected behavior
The user provided run image should be taken as base for the application image.
Alternatively, when this is not feasible to implement, the build should fail, advising the user to remove the
--run-image
parameter or the extension.Note: This is only an issue with extensions that fully replace the run image. An extension adding to the run image should be ok.
The text was updated successfully, but these errors were encountered: