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

Installing CRC breaks docker build #287

Closed
ctron opened this issue Jul 2, 2019 · 22 comments
Closed

Installing CRC breaks docker build #287

ctron opened this issue Jul 2, 2019 · 22 comments
Assignees
Labels
kind/documentation Documentation issues. status/stale Issue went stale; did not receive attention or no reply from the OP

Comments

@ctron
Copy link

ctron commented Jul 2, 2019

Last steps:

Expected behavior:

  • docker build has network access.

Actual behavior:

  • docker build fails due to network issues.

Workaround:

  • Remove all files containing crc in the file name from /etc/NetworkManager
  • Reload network manager – sudo systemctl reload NetworkManager
  • Restart docker – sudo systemctl restart docker

System:

Linux XXX 3.10.0-957.10.1.el7.x86_64 #1 SMP Thu Feb 7 07:12:53 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

Docker:

$ docker version
Client:
 Version:         1.13.1
 API version:     1.26
 Package version: docker-1.13.1-96.gitb2f74b2.el7.x86_64
 Go version:      go1.10.8
 Git commit:      b2f74b2/1.13.1
 Built:           Tue Apr  2 21:01:07 2019
 OS/Arch:         linux/amd64

Server:
 Version:         1.13.1
 API version:     1.26 (minimum version 1.12)
 Package version: docker-1.13.1-96.gitb2f74b2.el7.x86_64
 Go version:      go1.10.8
 Git commit:      b2f74b2/1.13.1
 Built:           Tue Apr  2 21:01:07 2019
 OS/Arch:         linux/amd64
 Experimental:    false
@gbraad
Copy link
Contributor

gbraad commented Jul 3, 2019

I am not sure about the issue here. We create a CRC specific birdge that should have no influence on your environment, so can you explain more what 'Boom!' actually is?

Can you provide some output from the docker build ?

Also, what is the platform you run this on and where does 'docker' come from (centos 7)?

@ctron
Copy link
Author

ctron commented Jul 3, 2019

I am not sure about the issue here. We create a CRC specific birdge that should have no influence on your environment, so can you explain more what 'Boom!' actually is?

I think I described the issue, please let me know what you are missing:

Expected behavior:

  • docker build has network access.

Actual behavior:

  • docker build fails due to network issues.

An output from the build would be e.g. curl failing to download a file.

Also, what is the platform you run this on and where does 'docker' come from (centos 7)?

Again, I think I posted that already. Please let me know what you are missing:

System:

Linux XXX 3.10.0-957.10.1.el7.x86_64 #1 SMP Thu Feb 7 07:12:53 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

Docker:

$ docker version
Client:
 Version:         1.13.1
 API version:     1.26
 Package version: docker-1.13.1-96.gitb2f74b2.el7.x86_64
 Go version:      go1.10.8
 Git commit:      b2f74b2/1.13.1
 Built:           Tue Apr  2 21:01:07 2019
 OS/Arch:         linux/amd64

Server:
 Version:         1.13.1
 API version:     1.26 (minimum version 1.12)
 Package version: docker-1.13.1-96.gitb2f74b2.el7.x86_64
 Go version:      go1.10.8
 Git commit:      b2f74b2/1.13.1
 Built:           Tue Apr  2 21:01:07 2019
 OS/Arch:         linux/amd64
 Experimental:    false

Docker itself comes from RHEL:

docker-1.13.1-96.gitb2f74b2.el7.x86_64
docker-client-1.13.1-96.gitb2f74b2.el7.x86_64
docker-common-1.13.1-96.gitb2f74b2.el7.x86_64

@gbraad
Copy link
Contributor

gbraad commented Jul 3, 2019

Are you using this from the Red Hat network?

problem is when you use dnsmasq with NM then you are actually putting nameserver 127.0.0.1 only entry to /etc/resolv.conf now if you create any container on this host (docker or podman) it will first check what is the entry on the /etc/resolve.conf if it is has 127.0.0.1 then it put 8.8.8.8 in the container’s /etc/resolv.conf which doesn’t have network connectivity if a user is using a corporate network because those networks often block other nameservers.

@ctron
Copy link
Author

ctron commented Jul 4, 2019

Are you using this from the Red Hat network?

Yes, I am running this being attached to a local Red Hat LAN. No VPN.

problem is when you use dnsmasq with NM then you are actually putting nameserver 127.0.0.1 only entry to /etc/resolv.conf now if you create any container on this host (docker or podman) it will first check what is the entry on the /etc/resolve.conf if it is has 127.0.0.1 then it put 8.8.8.8 in the container’s /etc/resolv.conf which doesn’t have network connectivity if a user is using a corporate network because those networks often block other nameservers.

I am not sure what you mean by the last paragraph. My expectation towards CRC would be, that it works inside the Red Hat network, like minikube and minishift work right now, inside the Red Hat network.

@gbraad
Copy link
Contributor

gbraad commented Jul 4, 2019 via email

@gbraad
Copy link
Contributor

gbraad commented Jul 4, 2019

A possible solution is to provide an override for the DNS: https://askubuntu.com/questions/475764/docker-io-dns-doesnt-work-its-trying-to-use-8-8-8-8

$ sudo vi /etc/docker/daemon.json

{
    "dns": ["10.0.0.1", "10.0.0.2"]
}

Note: replace the values with the nameservers as allowed by your network.

@gbraad
Copy link
Contributor

gbraad commented Nov 29, 2019

Closing this issue as this is unrelated to CRC.

@gbraad gbraad closed this as completed Nov 29, 2019
@cfergeau
Copy link
Contributor

docker and podman apparently have a --dns option which can be used as well
https://docs.docker.com/v17.09/engine/userguide/networking/default_network/configure-dns/

@ctron
Copy link
Author

ctron commented Nov 29, 2019

This is all fine, but I still think that CRC should not break an working docker installation. And while the problem manifests in Docker, installing CRC was the cause for this problem. So I would guess it is a CRC issue.

@praveenkumar
Copy link
Member

@ctron Should a warning at the end of crc start (link to a document) should be good enough since from crc we can't fix it and we are bound to use dnsmasq.

@ctron
Copy link
Author

ctron commented Nov 29, 2019

@praveenkumar That would at least be helpful. Any maybe a crc stop should revert to the original state of the host system.

@AndrienkoAleksandr
Copy link

I faced with this issue too. It would be nice for development flow to have crc and docker working both and in the same time on the working laptop.

@praveenkumar praveenkumar added the kind/documentation Documentation issues. label Nov 29, 2019
@praveenkumar praveenkumar reopened this Nov 29, 2019
@praveenkumar
Copy link
Member

@AndrienkoAleksandr yes but it is not limitation of CRC, if you run your own local dns server you will face the same. Please check containers/podman#4508 and moby/moby#23910 , what we can do is document it and put a note for user.

Any maybe a crc stop should revert to the original state of the host system.

@ctron we are trying to implement crc cleanup command to revert all the system changes.

@gbraad
Copy link
Contributor

gbraad commented Nov 29, 2019

we are trying to implement crc cleanup command to revert all the system changes.

This is because the setting is changed using crc setup and not crc start (as mentioned above). Therefore removing this setting with crc stop would be wrong as that would need a re-run of the setup.

I believe this should also be made more clearly during the crc setup steps... and perhaps with detecting if docker is installed.

Note: moving this to crc start and crc stop is a bad idea, as that would imply admin/root privileges would be needed to make this change.

@praveenkumar praveenkumar self-assigned this Nov 29, 2019
@ctron
Copy link
Author

ctron commented Nov 29, 2019

@AndrienkoAleksandr yes but it is not limitation of CRC, if you run your own local dns server you will face the same. Please check containers/libpod#4508 and moby/moby#23910 , what we can do is document it and put a note for user.

But why doesn't minishift suffer from this issue?

@praveenkumar
Copy link
Member

praveenkumar commented Nov 29, 2019

But why doesn't minishift suffer from this issue?

@ctron minishift never used the dnsmasq, this is more like a requirement from openshift4 side where we neeed to create the cluster ourself before bundle it and the cluster have to use a vaild domain name instead of IP which can't changed at later stage.

@gbraad
Copy link
Contributor

gbraad commented Nov 29, 2019

Minishift relies on external DNS provided by a service called xip.io/nip.io that just resolves to the IP address that is part of the actual FQDN. This means 'any' DNS would work that can resolve this domain, with the caveat that the IP address can never change during the lifetime of the cluster (restarts included). However, for CRC we use a local DNS that resolves api.crc.testing to a local IP address. The IP dddress is allowed to change, as long as the local DNS has the right IP address. We use dnsmasq for this since others had issues binding on port 53 when libvirt was using this already (but the sockert reuse does not work with other servers).

@ctron
Copy link
Author

ctron commented Dec 2, 2019

If this is just for a single DNS name, then why not use the "hosts" file?

@praveenkumar
Copy link
Member

@ctron it is not for single DNS name, otherwise we could've used the host file. Host file doesn't provide wildcard entry for domain name which is required in our case.

@ctron
Copy link
Author

ctron commented Dec 2, 2019

@praveenkumar Yes indeed. From @gbraad it looked to me as if you only have an issue with a single hostname:

However, for CRC we use a local DNS that resolves api.crc.testing to a local IP address.

@stale
Copy link

stale bot commented Feb 11, 2020

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.

@stale stale bot added the status/stale Issue went stale; did not receive attention or no reply from the OP label Feb 11, 2020
@stale stale bot closed this as completed Feb 25, 2020
@gbraad
Copy link
Contributor

gbraad commented Feb 25, 2020

This issue is obvious from this specific hostname, but all in crc.testing znd apps-crc.testing are affected.

Closing with wontfix. Crc cleanup is another issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/documentation Documentation issues. status/stale Issue went stale; did not receive attention or no reply from the OP
Projects
None yet
Development

No branches or pull requests

5 participants