From 5d655de5946acaab0c6025d47119be0d3ef43939 Mon Sep 17 00:00:00 2001 From: Harivansh Rathi Date: Wed, 25 Mar 2026 12:40:14 -0400 Subject: [PATCH] docker-compose build --- .dockerignore | 3 +++ README.md | 39 +++++++++++++++++++++++++++++++++++---- docker/Dockerfile | 11 +++++++++++ docker/docker-compose.yml | 8 ++++++++ 4 files changed, 57 insertions(+), 4 deletions(-) create mode 100644 .dockerignore create mode 100644 docker/Dockerfile create mode 100644 docker/docker-compose.yml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..4578d1c --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +.git +target +dist diff --git a/README.md b/README.md index 6e51de2..fb9dcd0 100644 --- a/README.md +++ b/README.md @@ -8,11 +8,33 @@ Desktop control CLI for AI agents on Linux X11. cargo install deskctl ``` -System deps (Debian/Ubuntu): +Build a Linux binary with Docker: + ```bash -sudo apt install libxcb-dev libxrandr-dev libclang-dev +docker compose -f docker/docker-compose.yml run --rm build ``` +This writes `dist/deskctl-linux-x86_64`. + +Copy it to an SSH machine where `scp` is unavailable: + +```bash +ssh -p 443 deskctl@ssh.agentcomputer.ai 'cat > ~/deskctl && chmod +x ~/deskctl' < dist/deskctl-linux-x86_64 +``` + +Run it on an X11 session: + +```bash +DISPLAY=:1 XDG_SESSION_TYPE=x11 ~/deskctl --json snapshot --annotate +``` + +Local source build requirements: +```bash +cargo build +``` + +At the moment there are no extra native build dependencies beyond a Rust toolchain. + ## Quick Start ```bash @@ -34,11 +56,20 @@ deskctl focus "firefox" Client-daemon architecture over Unix sockets (NDJSON wire protocol). The daemon starts automatically on first command and keeps the X11 connection alive for fast repeated calls. -## Requirements +## Runtime Requirements - Linux with X11 session - Rust 1.75+ (for build) +The binary itself only links the standard glibc runtime on Linux (`libc`, `libm`, `libgcc_s`). + +For deskctl to be fully functional on a fresh VM you still need: + +- an X11 server and an active `DISPLAY` +- `XDG_SESSION_TYPE=x11` or an equivalent X11 session environment +- a window manager or desktop environment that exposes standard EWMH properties such as `_NET_CLIENT_LIST_STACKING` and `_NET_ACTIVE_WINDOW` +- an X server with the extensions needed for input simulation and screen metadata, which is standard on normal desktop X11 setups + ## Wayland Support -Coming soon hopefully. The trait-based backend design means adding Hyprland/Wayland support is a single trait implementation with zero refactoring of the core which is good. +Coming soon. The trait-based backend design means adding Hyprland/Wayland support is a single trait implementation with zero refactoring of the core which is good. diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..b5ab9ce --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,11 @@ +FROM rust:1.94-bullseye + +WORKDIR /workspace + +COPY Cargo.toml Cargo.lock ./ +COPY assets ./assets +COPY src ./src + +RUN cargo build --release --locked + +CMD ["bash", "-lc", "mkdir -p /out && cp target/release/deskctl /out/deskctl-linux-x86_64 && chmod 755 /out/deskctl-linux-x86_64"] diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml new file mode 100644 index 0000000..5ff5719 --- /dev/null +++ b/docker/docker-compose.yml @@ -0,0 +1,8 @@ +services: + build: + build: + context: .. + dockerfile: docker/Dockerfile + user: "${UID:-1000}:${GID:-1000}" + volumes: + - ../dist:/out