I have a problem with connecting to my remote(DigitalOcean) docker engine. What I've done is
Result
Problem
Before I make a new context for the remote engine, I tried to run some docker command from my local client on my Mac laptop. Interesting part for me is none of the commands below asks for the id_rsa passphrase)
docker -H ssh://myuser@droplet_ip ps
-> ErrorDOCKER_HOST=ssh://myuser@droplet_ip docker ps
-> ErrorError
docker -H ssh://myuser@droplet_ip ps
error during connect: Get http://docker/v1.40/containers/json: command [ssh -l myuser -- droplet_ip docker system dial-stdio] has exited with exit status 255, please make sure the URL is valid, and Docker 18.09 or later is installed on the remote host: stderr=myuser@droplet_ip: Permission denied (publickey).
What step I missed? How can I connect to a remote docker engine?
It sounds like Docker may not allow ssh to prompt for a key passphrase when connecting. The easiest solution is probably to load your key into an ssh-agent
, so that Docker will be able to use the key without requesting a password.
If you want to add your default key (~/.ssh/id_rsa
) you can just run:
ssh-add
You can add specific keys by providing a path to the key:
ssh-add ~/.ssh/id_rsa_special
Most modern desktop environments run an ssh-agent
process by default.