docker-compose build

This commit is contained in:
Harivansh Rathi 2026-03-25 12:40:14 -04:00
parent b108be8afe
commit 5d655de594
4 changed files with 57 additions and 4 deletions

3
.dockerignore Normal file
View file

@ -0,0 +1,3 @@
.git
target
dist

View file

@ -8,11 +8,33 @@ Desktop control CLI for AI agents on Linux X11.
cargo install deskctl cargo install deskctl
``` ```
System deps (Debian/Ubuntu): Build a Linux binary with Docker:
```bash ```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 ## Quick Start
```bash ```bash
@ -34,11 +56,20 @@ deskctl focus "firefox"
Client-daemon architecture over Unix sockets (NDJSON wire protocol). 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. The daemon starts automatically on first command and keeps the X11 connection alive for fast repeated calls.
## Requirements ## Runtime Requirements
- Linux with X11 session - Linux with X11 session
- Rust 1.75+ (for build) - 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 ## 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.

11
docker/Dockerfile Normal file
View file

@ -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"]

View file

@ -0,0 +1,8 @@
services:
build:
build:
context: ..
dockerfile: docker/Dockerfile
user: "${UID:-1000}:${GID:-1000}"
volumes:
- ../dist:/out