From 4e8a4a5579e8e947546af499440ffebaea2fa12b Mon Sep 17 00:00:00 2001 From: crosstyan Date: Mon, 19 Jan 2026 12:18:03 +0800 Subject: [PATCH] init --- .devcontainer/devcontainer.json | 14 ++++++++++ Dockerfile | 18 +++++++++++++ README.md | 45 +++++++++++++++++++++++++++++++++ docker-compose.yml | 26 +++++++++++++++++++ 4 files changed, 103 insertions(+) create mode 100644 .devcontainer/devcontainer.json create mode 100644 Dockerfile create mode 100644 README.md create mode 100644 docker-compose.yml diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..4ade7f2 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,14 @@ +{ + "name": "zed-playground", + "dockerComposeFile": "../docker-compose.yml", + "service": "zed", + "workspaceFolder": "/workspaces/zed-playground", + "shutdownAction": "stopCompose", + "customizations": { + "vscode": { + "settings": { + "terminal.integrated.defaultProfile.linux": "bash" + } + } + } +} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ab6d4e1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +FROM stereolabs/zed:5.1-gl-devel-cuda12.8-ubuntu24.04 + +# Use USTC mirrors for faster access in China. +RUN sed -i 's|http://archive.ubuntu.com/ubuntu/|https://mirrors.ustc.edu.cn/ubuntu/|g' /etc/apt/sources.list \ + && sed -i 's|http://security.ubuntu.com/ubuntu/|https://mirrors.ustc.edu.cn/ubuntu/|g' /etc/apt/sources.list \ + && mkdir -p /etc/pip \ + && printf "%s\n" \ + "[global]" \ + "index-url = https://pypi.mirrors.ustc.edu.cn/simple" \ + "trusted-host = pypi.mirrors.ustc.edu.cn" \ + > /etc/pip.conf + +RUN apt-get update \ + && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + build-essential \ + cmake \ + git \ + && rm -rf /var/lib/apt/lists/* diff --git a/README.md b/README.md new file mode 100644 index 0000000..0cbed81 --- /dev/null +++ b/README.md @@ -0,0 +1,45 @@ +# ZED Playground + +This repo provides a Docker Compose setup and Dev Container config based on +`stereolabs/zed:5.1-gl-devel-cuda12.8-ubuntu24.04`. + +## Prerequisites + +- Docker + Docker Compose v2 +- NVIDIA Container Toolkit (GPU support) +- ZED camera connected via USB (optional) + +If you use GUI apps inside the container, you need X11 access from the host. + +## Quick Start (Docker Compose) + +1) Allow local X11 access for root: + +```bash +xhost +local:root +``` + +2) Start the container: + +```bash +docker compose up +``` + +3) Open a shell in the running container: + +```bash +docker compose exec zed bash +``` + +## Dev Container (VS Code / compatible) + +1) Open this folder in a Dev Container-capable editor. +2) It will use `.devcontainer/devcontainer.json` and `docker-compose.yml`. + +## Notes + +- If you are on Wayland, X11 forwarding may require XWayland. If GUI apps do + not appear, log into an X11 session or enable XWayland. +- USB devices are passed through via `/dev/bus/usb` and the container runs + `privileged` for camera access. +- The workspace is mounted at `/workspaces/zed-playground`. diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..a3c779b --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,26 @@ +services: + zed: + build: + context: . + dockerfile: Dockerfile + network: host + container_name: zed-dev + shm_size: "8gb" + volumes: + - .:/workspaces/zed-playground:cached + - /tmp/.X11-unix:/tmp/.X11-unix:rw + working_dir: /workspaces/zed-playground + environment: + DISPLAY: "${DISPLAY}" + NVIDIA_VISIBLE_DEVICES: "all" + NVIDIA_DRIVER_CAPABILITIES: "compute,graphics,utility,video" + HTTP_PROXY: "http://127.0.0.1:36000" + HTTPS_PROXY: "http://127.0.0.1:36000" + NO_PROXY: "localhost,127.0.0.1,::1,host.docker.internal" + privileged: true + devices: + - /dev/bus/usb:/dev/bus/usb + gpus: all + network_mode: host + stdin_open: true + tty: true