'SSH to Docker Container via a VM of GCP from local PC

Actually I have a little problem. I'm trying to connect to my docker container which is running on a virtual machine provided by GCP(Google Cloud Platform).

So I have my PC (A) from home trying to connect to the Docker machine (C) which is running on a virtual machine from Google (B).

So I have the following diagram :

A(Home PC .01) ===> B(Google cloud Platform Virtual Machine .02) ====> C (Docker Container .03)

Here .01 .02 .03 represent the IP address.

In command line it works perfectly via this command line:

ssh -i C:/path_private_keys -J [email protected] [email protected]

However when I copy this command line in VsCode via the Remote-SSH extension in the section: Add new ssh hosts

It generates a configuration file like this:

Host xxx.xxx.xxx.02
 HostName xxx.xxx.xxx.02
 IdentityFile C:/path_private_keys
 ProxyJump [email protected]
 User username_docker

However, this doesn't work and I don't understand why :/

Could someone please help me?

Sorry for my english i'm french



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source