Use localhost registry when flyte endpoint is localhost#893
Merged
Conversation
When the configured Flyte endpoint contains 'localhost', automatically use localhost:30000 as the image registry instead of ghcr.io/flyteorg. Also configure the buildx builder with host networking so it can reach localhost registries on the host machine. Signed-off-by: Kevin Su <pingsutw@apache.org>
kumare3
reviewed
Apr 2, 2026
| init_config = _get_init_config() | ||
| if init_config and init_config.client: | ||
| endpoint = init_config.client.endpoint | ||
| if endpoint and "localhost" in endpoint: |
Contributor
There was a problem hiding this comment.
What if someone port forwards? Maybe an env var to disable this
Member
Author
There was a problem hiding this comment.
They can use .clone() to override the registry. the original default registry (ghcr.io/flyteorg) doesn't work for them as well.
docker manifest inspect doesn't work with OCI manifests pushed by buildx to local/insecure registries. Switch to docker buildx imagetools inspect which handles both Docker and OCI manifest formats correctly. Also filter out attestation manifests from the platform list and handle single-platform images without a manifest list. Signed-off-by: Kevin Su <pingsutw@apache.org>
_ensure_buildx_builder now inspects the existing builder to verify it has the network=host driver option. If the option is missing, the builder is removed and recreated with the correct configuration. Signed-off-by: Kevin Su <pingsutw@apache.org>
wild-endeavor
approved these changes
Apr 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
localhost, automatically uselocalhost:30000as the image registry instead ofghcr.io/flyteorg--driver-opt network=hostso the BuildKit daemon can reach localhost registries on the host machine_get_base_registry()function that checks the initialized config endpoint dynamicallyTest plan
ghcr.io/flyteorgwhen endpoint is not localhostlocalhost:30000when endpoint containslocalhost