Connect to Docker engine running on a remote machine
We recommend using the Visual Studio Code Remote-SSH extension to connect to a remote machine running Docker engine, but it also possible to connect to the remote Docker engine directly, using SSH tunneling. Use ssh-keygen or similar to get and configure a public/private key pair for SSH authentication.
https://code.visualstudio.com/docs/containers/ssh