Container Development With Visual Studio Code Extensions, Docker, and SourcePro
As of Visual Studio Code 1.35.0, the Remote - Containers extension can be used to easily develop against seemlessly develop in Docker containers.
To learn more about Remote Development in Visual Studio Code check out Microsoft's guide.
A more detailed explanation of this repository can be found on the Rogue Wave blog.
Setting up the development container
- For first time users, follow Microsoft's getting started instructions.
- Clone this repository.
- Set up SourcePro:
- Download the appropriate SourcePro
license.keyfile and place it into the
- Open the project folder in Visual Studio Code.
- Press F1 and select the "Remote-Containers: Open Folder in Container..." command.
File & Folder structure
This project contains three main components:
.vscode, and the root-level files.
.devcontainer folder is responsible for setting up Visual Studio Code's integration with Docker.
In this example, we provide a basic
devcontainer.json which points to the
Dockerfile in the same directory.
license.key, and the installer file are all placed into this directory to simplify the process of using those files during the Docker image setup.
A detailed explination of how to use the
.devcontainer folder can be found in Microsoft's guide.
.vscode folder defines all Visual Studio Code specific options. It is worth noting the configurations specified in this directory are unaware of the container they run in. Instead they exist as if Visual Studio code had been run from within the container itself.
For this example we use the folder to specify a debug launch with GDB configuration in
tasks.json we call out the process for building our program. (By invoking
This example uses a barebones
For more information about building a C++ application in Visual Studio Code, please check Microsoft's guide.