Adding Existing Digital Ocean Droplet To Docker-Machine
Let’s make this entire process less cumbersome and somewhat less painful.
Install the latest
docker-machine using this document.
Log into your DigitalOcean (from now on, DO) dashboard and navigate to your droplet. Then open its console.
Afterwards, change the following setting to
/etc/ssh/sshd_config so that you can
ssh into your droplet using a plain text password, from your local machine.
Do not forget to revert this setting after you are done setting up the
Log into your droplet from local machine using
ssh and add the contents of your local machine’s
id_rsa.pub file (default location is
~/.ssh/id_rsa.pub) to the
~/.ssh/authorized_keys file on the droplet.
This step will enable password-less
ssh to your droplet from your local machine.
Now you can revert the setting from step 2.
Create a generic docker machine using the following command.
docker-machine create \ --driver generic \ --generic-ip-address=<DROPLET_IP_ADDR> \ --generic-ssh-user root \ --generic-ssh-key ~/.ssh/id_rsa \ <MACHINE_NAME>
The above command will generate some configuration files and you must be all set post this step.
Once the droplet is configured to be used with
docker-machine, you can issue your regular
docker-machine commands, like the following:
# ssh to your dropletdocker-machine ssh <MACHINE_NAME>
Hopefully this post might have alleviated some of your