-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
support buildah and operator multi-stage builds #563
Conversation
b5e00b0
to
9bdd8cd
Compare
@estroz Looks like this forces users to use |
I assume this only "breaks" setups where a user has enabled running docker as non-root, which is horribly unsafe. I don't think the SDK should feel any obligation to preserve that experience. That said, using buildah in general is a nice improvement, and its rootless feature will be a great benefit to SDK users. Thanks for adding support. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using buildah is nice but as Shawn said we don't want to force the dependency. I would prefer the code to detect it and use it if present; otherwise fallback to docker. Also if nothing is present let's be nice and fail with an error message instead of deep in the code.
Looking a bit more at buildah, it seems that 1 feature they are missing that we need is ARG-before-FROM functionality, which is in docker-ce 17+ (which technically means it is also not supported in fedora or RHEL without using docker's own rpm repos either). We need the ARG-before-FROM feature for the There is an issue tracking this, but there hasn't been much activity: containers/buildah#581 |
Note that containers/buildah#581 is dependent on openshift/imagebuilder#76. |
9bdd8cd
to
c10a100
Compare
c90530f
to
76be138
Compare
76be138
to
00d4118
Compare
b596193
to
9cfdf7d
Compare
4752fd3
to
3630add
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM other than some small changes to the dockerfiles
Co-Authored-By: estroz <[email protected]>
Co-Authored-By: estroz <[email protected]>
Co-Authored-By: estroz <[email protected]>
@estroz: PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
**Description of the change:** This PR adds buildah support. **Motivation for the change:** operator-sdk should support building image by using buildah. There is an existing discussion for motivation in #563 .
buildah
is a tool that builds OCI images, from its CLI interface or by interpreting Dockerfiles. RHEL does not supportdocker
above v1.13, preventing the SDK from leveraging the multi-stage build Dockerfile feature;buildah
supports this feature, and will continue to be supported in RHEL. See #431 for relevant discussion.This PR also adds CI support for
buildah
by building the latest version in an image and copying the binary, as well as that ofrunc
which is required to runbuildah bud ...
in our case, into the build VM.Relevant issues: #167