-
Notifications
You must be signed in to change notification settings - Fork 239
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
crc setup breaks docker networking #1095
Comments
It is a known issue that Docker will subsitute this nameserver with a public DNS record that will also not resolve for most corporate environments.
When possible, we will try to add a solution. can you provide details around the setup for Ubuntu? Please also see the issue #549 |
crc does not have any ubuntu support at all at the moment (not even "ubuntu awareness" to avoid trying to do too much on ubuntu), so it's not all surprising that it might be harmful when run on ubuntu :( |
Issue #287 offers 2 (untested) workarounds: See https://code-ready.github.io/crc/#dns-configuration-linux_gsg for more details regarding how CodeReady Containers sets up dnsmasq. It's not using |
Please look at: https://docs.docker.com/config/containers/container-networking/ and the option:
you can test this with:
Note: please replace the DNs value To solve this system-wide, you need to modify
Note: replace the values with those that work for you. You could for instance replace this with the hosts IP address if you are running a local dnsmasq instance. |
Thanks, configuring DNS directly for docker works for me but still, crc must contain a note in the documentation that it might change networking config and additional configuration might be needed...
|
This part would be #507 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I am putting it as doc label. |
@cfergeau I'm getting this documented. Does this issue only apply to Docker, or should we describe this more generally? |
I would say just docker |
Note, the network setup on macOS is currently changing. For Linux, we might wanna be more specific about the 'crc setup` command and process. See also: #2242 |
This is actually a known issue of Docker; networking/DNS lookups are broken when a Since we are reviewing the network anyway, and things have changed due to resolved, this needs to be reviewed anyway. Closed |
General information
crc setup
before starting it? YesCRC version
❯ crc version crc version: 1.7.0+fa7e558 OpenShift version: 4.3.1 (embedded in binary)
CRC status
Does not matter
CRC config
Host Operating System
It's ubuntu in my case but it's actuall for other linux, I believe
Steps to reproduce
crc setup
docker run curlimages/curl:7.69.1 -sv https://github.com
Expected: curl resolves github.com from container
Actual:
It's the only example, but there are others operations which do not work after
crc setup
, like the internet is not available in containers of minikube/minishift.It's caused by that fact that
crc setup
enables dnsmasq and it seems to be bound it to 127.0.1.1 by default (at least on Ubuntu/Fedora I tested):❯ cat /etc/resolv.conf # Generated by NetworkManager nameserver 127.0.1.1
And it's kind of expected that 127.x.x.x local server is not really available from docker containers.
crc delete
does not recover original NetworkManager configuration, so users must fix it manually, which has benefit: users like me learn more about Networking configuration :-DSo, it makes sense to consider making some backup of users original NetworkManager config.
Possible solutions
I wonder if it's possible to save users' network configuration and only add dnsmasq DNS server only as fallback one. Then the internet would be available in docker/VMs but the only
crc-testing
would not be resolved from there which is not critical.As an alternative, DNSMasq could be bound to a physical network interface that would be available from docker/VM, like ethernet or WiFi ones.
If crc is not able to provide universal solution for every linux: then maybe it makes even more sense to just provide users documentation how to configure dnsmasq properly and not break networking inside docker containers/VMs.
Additional info
/etc/dnsmasq.conf content
The text was updated successfully, but these errors were encountered: