VS Code Remote Development using a docker container hosted in the cloud

Viewed 580

With the VS Code extension Visual Studio Code Remote - Containers I can develop inside a container that is spun up on my local computer via Docker Desktop.

Is there any way to develop inside a container hosted on Azure, AWS, Google Cloud, or any other cloud system instead?

I can't use Docker Desktop locally because I'm on a Macbook Pro with Apple Silicon, meaning that Docker does not work the same way as it would on an Intel chip.

UPDATE 2021-12-04:

I solved the issue by using GitHub Codespaces

1 Answers

You can use docker context

It forwards the remote docker socket via ssh to your local machine

docker context create NAME_OF_THE_CONTEXT --docker "host=ssh://$SERVER_USER_NAME@$SERVER_IP"

Use the context

docker context use NAME_OF_THE_CONTEXT

Now you can run docker commands in your local terminal that will be executed on the remote host.

So now you can connect to remote containers via VSCode as if the containers are running remotely.

Related