Docker Container Setup - uw-advanced-robotics/taproot GitHub Wiki

This setup is not recommended because we still do not support deploying to the development board from the Docker Container, However, this guide is still complete and will allow you to build code for all supported targets and run unit tests.

  1. Install Docker Desktop. The macOS and Linux instructions will work as-is. If you are on Windows, there are two options:

    • If you are on Windows 10 version 2004 or later (how do I know?), the relevant guide is here. Make sure you click "Enable WSL 2 Features" in the Docker installer.
    • If you cannot update to Windows 10 version 2004 (recommended) but are running Windows 10 Pro (not Home), you can follow this guide to use the Hyper-V backend instead.
  2. Install Visual Studio Code.

  3. Install git.

  4. Open Visual Studio Code.

  5. On the left of the editor, click the "extensions" icon (looks like stacked squares). Search for "Remote - Containers" and press "Install".

  6. Copy this URL onto your clipboard: https://gitlab.com/aruw/controls/taproot-template-project.git

  7. Press Ctrl+Shift+P and search for "Remote-Containers: Clone repository in container volume...". Press enter.

  8. Paste the URL you copied previously. DO NOT select the "GitHub" shortcut. Press enter.

  9. Select "Create a unique volume".

  10. Wait for vscode to initialize. This may take minutes, since it is downloading all the required tools in the form of a multi-gigabyte compressed file system image.

    • Note: During this time, if you are having trouble with your git credentials, you can specify or update them through a Windows GUI. If you're on windows open the Credential Manager app and go to Windows Credentials. Then correct your git credentials stored under git:https://gitlab.com before trying to clone again.

Now that you have the environment, let's test it out! Press Ctrl+Shift+P, type "Focus Next Terminal", and press Enter. In this terminal, type cd template-project && scons run-tests -j4 and press Enter. After building our code, it should run the tests and print a message indicating that all tests passed.

Reconnecting to the Docker container in the future

Following the above instructions again will work, but is not the most efficient way to reopen the container. Instead, from a new vscode window, select it from the "recent" menu:

Alternately, you can do so via the "Remote Explorer" pane:

Optional: prevent Docker Desktop from running on startup

By default, Docker will likely be configured to run on startup. Your mileage may vary, but this may be frustrating. If so, you can disable it! Open the Docker Desktop settings, which on Windows can be accessed via the Docker icon in the system tray:

The "General" tab has a checkbox for disabling auto-start.

In the future, if you attempt to load the repository within the dev container and haven't manually started Docker, you will get the following error:

In this case, you can launch Docker manually and hit "Retry". On Windows, Docker Desktop can be started by searching for "docker" in the Start menu.

We also recommend you stop Docker when you're done! This can be done on Windows via the same icon in the system tray. This will help preserve battery life and RAM.

⚠️ **GitHub.com Fallback** ⚠️