odin-detector/odin-data

View on GitHub
.devcontainer/devcontainer.json

Summary

Maintainability
Test Coverage
// For format details, see https://containers.dev/implementors/json_reference/
{
    "name": "odin-data devcontainer",
    "build": {
        "dockerfile": "../Dockerfile",
        "context": "..",
        "target": "developer"
    },
    "remoteEnv": {
        // Allow X11 apps to run inside the container
        "DISPLAY": "${localEnv:DISPLAY}"
    },
    "customizations": {
        "vscode": {
            "settings": {
                "python.defaultInterpreterPath": "/venv/bin/python",
                // Disable auto port forwarding when using --net=host
                "remote.autoForwardPorts": false
            },
            "extensions": [
                "ms-python.python",
                "github.vscode-github-actions",
                "tamasfe.even-better-toml",
                "redhat.vscode-yaml",
                "ryanluker.vscode-coverage-gutters",
                "charliermarsh.ruff",
                "ms-vscode.cmake-tools",
                "ms-vscode.cpptools"
            ]
        }
    },
    // For docker, VSCODE_REMOTE_USER must be set to your username. You will run with
    // full sudo rights. For podman, it should be left blank. You will run as root
    // inside, but host mounts will be owned by your user id and permissions will be
    // limited to those of the user on the host.
    "remoteUser": "${localEnv:VSCODE_REMOTE_USER}",
    "features": {
        // Some default things like git config
        "ghcr.io/devcontainers/features/common-utils:2": {
            "upgradePackages": false
        }
    },
    "runArgs": [
        // Allow the container to access the host X11 display and ports on localhost
        "--net=host",
        // Make sure SELinux does not disable with access to host filesystems like /tmp
        "--security-opt=label=disable"
    ],
    // Mount the parent as /workspaces so we can add peer projects to the workspace
    "workspaceMount": "source=${localWorkspaceFolder}/..,target=/workspaces,type=bind",
    "mounts": [
        // Mount /dev/shm for odin-data applications to use
        "source=/dev/shm,target=/dev/shm,type=bind"
    ],
    // After the container is created, install the python project in editable form
    "postCreateCommand": "pip install $([ -f dev-requirements.txt ] && echo '-c dev-requirements.txt') -e './python[dev]'"
}