Issue type: creating virtual machines
OS: Windows 10 Professional 1903 64 bit
App version: Server Version: 18.09.2
Product License: Community Engine
I’m trying to get started with Hyper-V virtural machines and Docker on Windows 10 Professional.
I’m following the Getting Started - Swarms tutorial. All other tutorials in that series have been run successfully.
I’m using a private registry that I’ve created running on an OSS Nexus 3 (3.16.1-02) server. I’ve successfully logged in, pushed, and pulled images from the hosted repository using a self-signed certificate.
My first problem is in creating virtual machines that use my internal DNS server as the name server.
Things I’ve tried:
- Change my Windows 10 Professional machine to use the internal DNS server
- Change the virtual switch to use the internal DNS server
- Change the docker for windows configuration to use the internal DNS server
- Create the virtual machine with:
docker-machine create -d hyperv --hyperv-virtual-switch “myswitch” --engine-opt “dns=internal_ip_address” myvm1
docker-machine create -d hyperv --hyperv-virtual-switch “myswitch” --engine-opt dns=internal_ip_address myvm1
However, when I execute the following:
docker-machine ssh myvm1 “cat /etc/resolv.conf”, it always returns with:
This is my router, and also the default DNS server provided by DHCP. This means that I cannot connect to my private docker registry.
The only way I’ve found to get around this is the following:
docker-machine ssh myvm1 $ sudo -i # echo "search home" > /etc/resolv.conf # echo "nameserver internal_ip_address" >> /etc/resolv.conf # /etc/init.d/docker restart # exit $ exit
This is annoying and doesn’t survive reboots.
I still can’t connect with docker login to my private registry, because I haven’t figured out where to put the self-signed certificate. I’ve generated the PEM file, but docker login still thinks it’s not a trusted connection.
I would really like to create virtual machines using the specified DNS server in /etc/resolv.conf.
Pointers would be greatly appreciated.