-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add sdk base image #3902
Add sdk base image #3902
Conversation
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.
One suggestion and one thing to fix for multi-arch manifest building.
|
||
image-push-sdk: | ||
./hack/image/push-image-tags.sh $(OPERATOR_SDK_IMAGE):dev $(OPERATOR_SDK_IMAGE) | ||
|
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.
I think we also need an image-push-sdk-multiarch
target.
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.
Can you elaborate on this? I figured we only needed amd64 since we are building FROM ubi-8. Do we need to support other bases as well?
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.
Yeah I think we should build it as a multi-arch image supporting all of the architectures that we produce the SDK binary for.
ubi8 is already a multiarch manifest so it should "just work" with all of the architectures we care about. I think we can just mimic what we do for the helm and ansible images.
@@ -0,0 +1,3 @@ | |||
FROM registry.access.redhat.com/ubi8/ubi | |||
|
|||
COPY operator-sdk-dev-linux-gnu /usr/local/bin/operator-sdk |
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.
Nit, and can definitely be done later...
WDYT about making this a multi-stage dockerfile where stage 1 copies in the project and builds it, and stage 2 copies the binary from stage 1?
That would eliminate the need for the hack/image/build-sdk-image.sh
script, and would be a good exemplar to convert the other image build scripts and Dockefiles over.
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.
Actually it does look like a script may still be necessary so that we can centralize the logic around building the image and then loading it into kind. We could have a generic script (e.g. ./build-image.sh` that takes a context directory, Dockerfile, and image name) that does this work.
Given that, a follow-on probably makes more sense to do a standalone refactor of the existing Dockerfiles, build scripts, and Makefile targets.
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.
WDYT about also setting:
ENTRYPOINT ["/usr/local/bin/operator-sdk"]
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.
@joelanford would that not print the help text exit immediately? Yeah, this simplifies the invocation.
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
f3af098
to
e9eaf35
Compare
New changes are detected. LGTM label has been removed. |
If anyone else needs to test the image builds, this is how I did it: |
/retest |
@joelanford I made some substantive changes since you approved. |
e9eaf35
to
ea99460
Compare
Rebased latest master, CI was still failing due to dependency problem (ansible 2.10, now pinned to 2.9) that has already been fixed. |
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.
One suggestion, otherwise LGTM.
@@ -0,0 +1,5 @@ | |||
FROM registry.access.redhat.com/ubi8/ubi |
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.
FROM registry.access.redhat.com/ubi8/ubi | |
FROM registry.access.redhat.com/ubi8/ubi-minimal:latest |
cp $ROOTDIR/build/operator-sdk-dev-linux-gnu . | ||
docker build -f $ROOTDIR/hack/image/sdk/Dockerfile -t $1 . | ||
|
||
# TODO(asmacdo) any reason to load image into kind? |
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.
The caller should be doing this.
The docker image builds, but we need to exercise the tag/push logic before merge
/hold
This PR results in the creation of 4 new images published to quay: