When developing containerized applications, it is common to try to debug build and runtime issues by attaching a shell to the running container using docker exec --it {containerID} /bin/sh.
This technique allows you to inspect the container environment via the command line, but it doesn’t give you a rich set of tools to diagnose issues.

In this post, we’ll look at how you can attach Visual Studio Code to your container so that you can use the full power of VS Code, including debugging, to inspect the container, figure out what is going wrong, and fix it.

The Remote - Containers extension, which launched in May of this year, allows you to connect your local VS Code to a container host while maintaining all of your personalized settings, themes, and key bindings

#visual studio code #docker containers

Inspecting Docker Containers with Visual Studio Code
1.45 GEEK