How to reconnect to docker instance
I’ll start from the beginning.
- I’ve created an Ubuntu machine with docker installed on Azure.
- On the top I created two docker containers, I used to connect from an old computer using docker-machine for management tasks.
- I’ve changed my computer, so I need to connect from the new one.
- I’ve added my azure subscription
However when I try the
docker-machine cdmdlet to the existing container I have the following error message:
PS C:\WINDOWS\system32> docker-machine ssh vm name Host does not exist: "vm name".
The machine is running but I’ll guess I’ll have to recreate the certificates used for the connection.
I’ve tried the following with no luck:
PS C:\WINDOWS\system32> docker-machine regenerate-certs vm name Regenerate TLS machine certs? Warning: this is irreversible. (y/n): y Regenerating TLS certificates Host does not exist: "vm name"
I no longer have access to the old machine.
Has anyone been into the same situation?
Any thoughts are welcome.
One Solution collect form web for “How to reconnect to docker instance”
You’ll have to recreate the machine using the generic driver:
docker-machine create \ --driver generic \ --generic-ip-address=203.0.113.81 \ --generic-ssh-key ~/.ssh/id_rsa \ vm
Replace the information accordingly.
Note that this does NOT remove any data on the target instance, rather it just configures docker to talk to machine if it isn’t already, and also generates new certificates so it can communicate with the instance.