Installing Marlin (VSCode devcontainer)
A dev container is a pre-built Docker environment that is preinstalled with all the dependencies needed to build Marlin with VSCode. The devcontainer not only creates the code compilation environment but it also configures your VSCode with all the extensions needed. The end result is a completely configured VSCode ready to compile and upload Marlin.
The dev container official documentation can be found here.
- Windows: Docker Desktop 2.0+ on Windows 10 Pro/Enterprise. Windows 10 Home (2004+) requires Docker Desktop 2.3+ and the WSL 2 back-end. (Docker Toolbox is not supported. Windows container images are not supported.)
- macOS: Docker Desktop 2.0+.
- Linux: Docker CE/EE 18.06+ and Docker Compose 1.21+. (The Ubuntu snap package is not supported.)
This quick-start covers how to set up a dev container for an existing project to use as your full-time development environment using existing source code on your filesystem. Follow these steps:
Start VSCode, run the Remote-Containers: Open Folder in Container… command from the Command Palette (F1) or quick actions Status bar item, and select the Marlin project folder.
The VSCode window will reload and start building the dev container. A progress notification provides status updates. You only have to build a dev container the first time you open it; opening the folder after the first successful build will be much quicker.
After the build completes, VSCode will automatically connect to the container.
You can now interact with your project in VSCode just as you could when opening the project locally. From now on, when you open the project folder, VSCode will automatically pick up and reuse your dev container configuration.
While using this approach to bind mount the local filesystem into a container is convenient, it does have some performance overhead on Windows and macOS. There are some techniques that you can apply to improve disk performance, or you can open a repository in a container using a isolated container volume instead.