The Remote-Container extension allows you to connect or launch a container and connect VS Code to the container. This is different than connecting to a Container shell as you have the full development environment inside the container. Additionally, you can control quickly the mounting of files or folders from your host into the container speeding up development time.
In the lab we will launch our Python Flask demo application in Debug mode.
- Open the VS Code Marketplace
- Type
remote-container
in the Marketplace search - Click
install
on the Official Docker extension
OK, we will launch a sample Development container to see the possibilities with the Remote-Container extension.
- Open the Command Palette
Mac ⇧⌘P
Windows CTRL + SHIFT + P
- Type
Remote-Container: Try Sample
- Select
Python
Sample Application - VS Code will refresh and you will be attached to the Python sample. Now you can run debug, everything directly inside the container.
- Open the Command Palette
Mac ⇧⌘P
Windows CTRL + SHIFT + P
- Type
Remote-Container: Open Folder in Container
- You can then choose a folder to mount in the container which will again re-launch VS Code with the mounted folder.