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

On VPN, puller fails to resolve dns name on MacOS #1354

Open
suman-ganta opened this issue Jan 7, 2020 · 17 comments
Open

On VPN, puller fails to resolve dns name on MacOS #1354

suman-ganta opened this issue Jan 7, 2020 · 17 comments
Labels
Can Close? Will close in 30 days unless there is a comment indicating why not

Comments

@suman-ganta
Copy link

When puller is used to pull a docker image over VPN on MacOS. The root cause seem to be this issue. Apparently the go_library definition need to have cgo=True for this to work on Mac.

So, to summarize the issue, the host name resolution is not honoring Mac's DNS configuration, instead it is always reading /etc/resolv.conf to get the name servers.

@smukherj1
Copy link
Collaborator

I'm a little apprehensive of straying too far from default options when building the various Go binaries. Users of rules_docker can build their own versions of the binary, upload them somewhere and override the http_file directive here by calling http_file prior to importing rules_docker with the name of the http_file target set to go_puller_darwin. Could you please first try this and confirm if this fixes your issue?

@gibfahn
Copy link
Contributor

gibfahn commented Apr 24, 2020

I can confirm that building the binary on macOS does fix the issue (as expected).

So I guess there are three possibilities for rules_docker:

  1. Wait for Go upstream to fix the issue.
  2. Build this target with cgo enabled.
  3. Use a library that fixes the issue

Adding an example failure for others who might be searching for this issue:

2020/04/24 11:38:53 Image pull was unsuccessful: reading image "<dockerURL>": Get "https://<dockerURL>": dial tcp: lookup docker... on <IP> no such host


Example cgo failure without a C toolchain configured:

$ docker run --rm -it -v $PWD:/code -w /code l.gcr.io/google/bazel bazel --platforms=@io_bazel_rules_go//go/toolchain:darwin_amd64_cgo container/go/cmd/puller
INFO: Build option --platforms has changed, discarding analysis cache.
ERROR: While resolving toolchains for target @io_bazel_rules_go//:cgo_context_data: No matching toolchains found for types @bazel_tools//tools/cpp:toolchain_type. Maybe --incompatible_use_cc_configu2020-04-24re_from_rules_cc has been flipped and there is no default C++ toolchain added in the WORKSPACE file? See https://github.com/bazelbuild/bazel/issues/10134 for details and migration instructions.
ERROR: Analysis of target '//container/go/cmd/puller:puller' failed; build aborted: No matching toolchains found for types @bazel_tools//tools/cpp:toolchain_type. Maybe --incompatible_use_cc_configure_from_rules_cc has been flipped and there is no default C++ toolchain added in the WORKSPACE file? See https://github.com/bazelbuild/bazel/issues/10134 for details and migration instructions.
INFO: Elapsed time: 0.355s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded, 593 targets configured)

To use a built version add this above the rules_docker setup:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file")

# Built on macOS with: bazel build container/go/cmd/puller
http_file(
    name = "go_puller_darwin",
    executable = True,
    urls = [
      "file:///tmp/darwin-puller"
      "https://example.com/puller-darwin-amd64",
    ],
    # sha256sum $(bazel run --run_under "echo " container/go/cmd/puller)
    sha256 = "606ad426b6c09c8623dda7bfb123365413b6b80eb0c126d2f7b5d810ea3aed78",
)

@smukherj1
Copy link
Collaborator

Regarding the C/C++ toolchain issue, I asked for migration help here.

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had any activity for 180 days. It will be closed if no further activity occurs in 30 days.
Collaborators can add an assignee to keep this open indefinitely. Thanks for your contributions to rules_docker!

@github-actions github-actions bot added the Can Close? Will close in 30 days unless there is a comment indicating why not label Mar 18, 2021
@gibfahn
Copy link
Contributor

gibfahn commented Mar 22, 2021

Please don't close this, continuous pain for us 😁

Don't think I have the ability to assign someone to this.

@github-actions github-actions bot removed the Can Close? Will close in 30 days unless there is a comment indicating why not label Mar 25, 2021
@gibfahn
Copy link
Contributor

gibfahn commented Apr 13, 2021

Looks like #1795 would fix this as it runs the macOS build on macOS 🎉

@zoidyzoidzoid
Copy link
Contributor

I should work on getting #1795 merged

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had any activity for 180 days. It will be closed if no further activity occurs in 30 days.
Collaborators can add an assignee to keep this open indefinitely. Thanks for your contributions to rules_docker!

@github-actions github-actions bot added the Can Close? Will close in 30 days unless there is a comment indicating why not label Oct 22, 2021
@gibfahn
Copy link
Contributor

gibfahn commented Oct 24, 2021

Still an issue

@github-actions github-actions bot removed the Can Close? Will close in 30 days unless there is a comment indicating why not label Oct 25, 2021
@github-actions
Copy link

This issue has been automatically marked as stale because it has not had any activity for 180 days. It will be closed if no further activity occurs in 30 days.
Collaborators can add an assignee to keep this open indefinitely. Thanks for your contributions to rules_docker!

@github-actions github-actions bot added the Can Close? Will close in 30 days unless there is a comment indicating why not label Apr 23, 2022
@gibfahn
Copy link
Contributor

gibfahn commented Apr 25, 2022

Still an issue

@github-actions github-actions bot removed the Can Close? Will close in 30 days unless there is a comment indicating why not label Apr 26, 2022
@github-actions
Copy link

This issue has been automatically marked as stale because it has not had any activity for 180 days. It will be closed if no further activity occurs in 30 days.
Collaborators can add an assignee to keep this open indefinitely. Thanks for your contributions to rules_docker!

@github-actions github-actions bot added the Can Close? Will close in 30 days unless there is a comment indicating why not label Oct 23, 2022
@gibfahn
Copy link
Contributor

gibfahn commented Oct 30, 2022

Still an issue

@github-actions github-actions bot removed the Can Close? Will close in 30 days unless there is a comment indicating why not label Oct 31, 2022
@shs96c
Copy link

shs96c commented Dec 16, 2022

It's still an issue

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had any activity for 180 days. It will be closed if no further activity occurs in 30 days.
Collaborators can add an assignee to keep this open indefinitely. Thanks for your contributions to rules_docker!

@github-actions github-actions bot added the Can Close? Will close in 30 days unless there is a comment indicating why not label Jun 15, 2023
@zoidyzoidzoid
Copy link
Contributor

You can try moving to rules_oci.

@github-actions github-actions bot removed the Can Close? Will close in 30 days unless there is a comment indicating why not label Jun 16, 2023
Copy link

This issue has been automatically marked as stale because it has not had any activity for 180 days. It will be closed if no further activity occurs in 30 days.
Collaborators can add an assignee to keep this open indefinitely. Thanks for your contributions to rules_docker!

@github-actions github-actions bot added the Can Close? Will close in 30 days unless there is a comment indicating why not label Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Can Close? Will close in 30 days unless there is a comment indicating why not
Projects
None yet
Development

No branches or pull requests

5 participants