- Install and start vscode, Docker-Desktop and (optionally) git.
- Download and use this repository from as template to create your own. To do this, you have 3 option.
- Create an own GitHub repository via template
- Download template as zip file.
- Clone the repository and copy the resulting files into your own repository. (Do not commit any changes to the original repository!)
- Open the folder of your local repository on your machine in vscode.
- In vscode on the left side click on the extensions-icon. Search for the following extensions and install them:
Docker
,Dev Containers
. - Press Command/Control + Shift + P and search for
Dev Container
. Select something likeDev Container: (Re)build Container
. The first time, this can take a while (~1h) because a docker image, some tools and the required dependencies are downloaded and built with a single core (multi-core build results in errors).
Your local setup is done, now you are working in your dev container.
Last steps for cpp development:
- Asjust the
"cmake.sourceDirectory": "/workspaces/<repo-name>/<optional-sub-folder>"
field in.vscode/settings.json
to your own source directory. - Build/compile using the bottom menu of vscode
- At the bottom left corner you can validate that you are now using a remote connection to your local dev container:
c++ at dektop-linux
. - Via clicking on the blue corner, you can "Close the remote connection" and "Reopen in Container".
- Via the bottom menu of vscode, you can build and run your files.
- To access the desktop/gui of your devcontainer: Open http://localhost:6080/ in a browser (default password: vscode).