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

tiltfile: Add disable_push option to build_docker function #6499

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cm226
Copy link

@cm226 cm226 commented Feb 7, 2025

Added a disable_push flag to the docker_build function, we wanted this for our CI environment.
We use minikube in our CI deployment, and share a docker socket with the build environment, so no need to push images.

Went with a flag per image, because I could "sort-of" imagine cases where it might be useful to be able have different push behavior per image, although willing to be corrected on that

resolves #1730

@cm226 cm226 force-pushed the master branch 3 times, most recently from 924290b to 9774325 Compare February 7, 2025 20:21
@nicks
Copy link
Member

nicks commented Feb 8, 2025

hello! i'm a little bit confused by the bug report -- tilt should automatically detect when minikube is exposing it's docker socket, and skip the push in this case. (note that the issue you linked to mentions this). can you share the output of tilt doctor and how your minikube env is set up?

for background --

the comment you linked to was written 5 years ago, so we've learned a lot since then! i think most of us agree that adding disable_push to custom_build was a mistake. it's difficult to use correctly, and then people have to add more workarounds to fix the problems it creates. so these days we lean more towards reading the configuration off the cluster, rather than adding it to the tiltfile.

@cm226
Copy link
Author

cm226 commented Feb 11, 2025

Hi, Thanks for getting back @nicks.

I understand re background info.

Our use case is we are running minikube as part of a CI job. The host that the CI job runs on is shared with other jobs/users, who may also be running minikube. So we create a cluster with a custom name. We are guessing this is why tilt is not detecting that the cluster its deploying to is minikube. Sorry I have been meaning to have a look at tilts behaviour to confirm this, but haven't had time yet.

If true, does tilt have some way of supporting this?

thanks

@nicks
Copy link
Member

nicks commented Feb 11, 2025

does it fix the issue if you make sure the cluster has the prefix minikube?

@nicks
Copy link
Member

nicks commented Feb 11, 2025

(i'm pretty sure tilt uses other ways of detecting that the cluster is minikube that will work even if the cluster is renamed, but changing the name will at least test if our hypothesis is correct)

what does tilt doctor say?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

docker_build configuration for no-push environments
2 participants