How to connect remote docker instance using Pulumi? #9010
-
Hi folks, I have created VM instance in GCP using pulumi and installed docker. And I am trying to connect remote instance of the docker but its getting failed to due to connection establishment (asking for a key verification in a pop up window). const remoteInstance = new docker.Provider(
"remote",
{
host: interpolate`ssh://user@${externalIP}:22`,
},
{ dependsOn: dockerInstallation }
); I can able to run docker containers locally. But want to run the same in VM. The code snippet can be found here Any assistance you can provide would be greatly appreciated. Thank you !!! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
This is ultimately not a Pulumi problem, but an issue with SSH. In order for the docker provider to connect correctly, you need to be able to connect to the In order to do this, you'll need to make sure your private key uses an SSH agent or there's no password on the private key. You'll also need to disable host key verification. The quickest way to do this is to add the following to
This is not recommended permanently (you should scope the verification to a specific hostname and/or configure verification correctly) but this will allow you to connect to the new instance. |
Beta Was this translation helpful? Give feedback.
This is ultimately not a Pulumi problem, but an issue with SSH. In order for the docker provider to connect correctly, you need to be able to connect to the
remoteInstance
with passworddless SSH.In order to do this, you'll need to make sure your private key uses an SSH agent or there's no password on the private key.
You'll also need to disable host key verification. The quickest way to do this is to add the following to
~/.ssh/config
:This is not recommended permanently (you should scope the verification to a specific hostname and/or configure verification correctly) but this will allow you to connect to the new instance.