Fedora 25 uses NetworkManager by default. When the machine has no network connection at all, such as no Ethernet cable and no Wi-Fi, NetworkManager may not create /etc/resolv.conf. Docker containers depend on that file for DNS resolution, so in this situation Docker containers can fail to start.
One workaround is to create a small script under /etc/NetworkManager/dispatcher.d/pre-up.d so that resolv.conf exists before the network comes up.
Script content:
1 |
|
Then make the script executable so it can actually run.
After that, you can test by rebooting the system with the network cable unplugged and Wi-Fi disabled. Because /etc/resolv.conf is created early, Docker containers should still be able to start.
This may also apply to other Linux distributions, though I have not tested it outside Fedora.