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

Makefile: docker-build should use --load for newer docker build aliased to buildx #4547

Closed
wants to merge 1 commit into from

Conversation

kaovilai
Copy link

@kaovilai kaovilai commented Feb 7, 2025

…ed to buildx

Fixes #4546

Same as migtools/oadp-non-admin#180

Related: #4545

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Feb 7, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: kaovilai
Once this PR has been reviewed and has the lgtm label, please assign kavinjsir for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 7, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @kaovilai. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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-sigs/prow repository.

@camilamacedo86
Copy link
Member

Hi @kaovilai 👋

Really appreciate you taking the time to improve Kubebuilder! 🚀

I hope you don’t mind, but I’ll close this PR with the following reference:
Issue #4546 - Comment.

If you disagree and still think we should add this change,
please feel free to reopen the PR for further discussion.

Thanks again for your contribution! 😊

@@ -183,7 +183,7 @@ run: manifests generate fmt vet ## Run a controller from your host.
# More info: https://docs.docker.com/develop/develop-images/build_enhancements/
.PHONY: docker-build
docker-build: ## Build docker image with the manager.
$(CONTAINER_TOOL) build -t ${IMG} .
$(CONTAINER_TOOL) build --load -t ${IMG} .
Copy link
Member

@camilamacedo86 camilamacedo86 Feb 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is the default docker build and it is working fine. We should not add the flag here.

You probably want to replace the --flag push with --load in the docker buildX instead, see: https://github.com/kubernetes-sigs/kubebuilder/pull/4547/files#diff-e5d6d4f9d67174f1f3764674eb786688353c77cef8514e24d1323e55e5a4a7e8R192-R209

However, the WARNING is only faced in the buildx(above target) when it has no flags --load or --push You removed it from your own project.

Copy link
Author

@kaovilai kaovilai Feb 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docker buildx build --push do not require --load at all.. if you have --push, you can skip --load.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @kaovilai

See: #4546 (comment)

I reproduce your scenario:

You are calling docker buildx without ANY of the flags.
It is required to have --load or push

And this target here is docker build ( should not use any of those )
You can either validate the behaviour with the samples under testdata to check that all generated by Kubebuilder works fine.

So, I am closing this one as deferred if you do not mind

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@camilamacedo86 per #4546 (comment) this can be triggered with just docker-build per my reproduce. I did not modify the default scaffold.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is one of the PRs that benefits the users of the default scaffold without modification.

@camilamacedo86
Copy link
Member

Closing this based on the comment : #4546 (comment).

We should not do this change.
But thank you a lot for raising it and trying to contribute to the project.

kaovilai added a commit to kaovilai/bugreport that referenced this pull request Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

docker-build should use --load for docker with buildx default client
3 participants