0

I've got a docker-compose.yml file which defines 3 services: MySQL db, ASP.NET Core api application and Angular application. The last two images are built locally, not pulled from a remote repository. How am I supposed to log in from my local machine to Digital Ocean droplet and push my services on it?

I tried

docker-machine create --driver digitalocean --digitalocean-access-token=myToken --digitalocean-ssh-key-path myPath  --digitalocean-ssh-user "root" dropletName

But it only creates a droplet. I don't want to create it because it is already created.

What's the algorithm to attach my local bash to the DO droplet's console and run docker-compose up? Or maybe I misunderstand the deployment procedure with Docker, what does it look like then?

ZirkoViter
  • 101
  • 2

1 Answers1

0

Use generic machine driver. From the docs:

if you would like to import an existing host to allow Docker Machine to manage

Use command:

docker-machine create --driver generic --generic-ip-address 111.111.111.111 --generic-ssh-key c:/ssh/digital-ocean droplet_name

In case of existing host the create command only creates a folder on your local machine (where Docker Client is run) with some files describing a connection.

Possible problem

In my case I used Git Bash to connect to remote host with the command above. It seemed not working because it freezes on the line

Waiting for SSH to be available...

and then (in the best case) it completes with:

Error creating machine: Error detecting OS: Too many retries waiting for SSH to be available. Last error: Maximum number of retries (60) exceeded

The "solution" to this was not obvious. I opened another bash window and checked whether the machine was created.

docker-machine ls

And it really was. Now I was able to activate it in my Docker Client with

docker-machine env machineName
ZirkoViter
  • 101
  • 2