Files
cursor-devbox/Dockerfile
T
Ubuntu 90c6b6c425
build-and-push / build (push) Successful in 8m40s
Force cursor-agent egress through node2 SOCKS5 via local CONNECT bridge
The Bun-based cursor-agent only honors http://-scheme HTTP(S)_PROXY values
and silently ignores socks5(h):// — with the pod's socks5h env it egressed
directly. Add devbox-proxy-bridge (loopback HTTP CONNECT -> node2 SOCKS5),
run it supervised from the entrypoint, and shadow cursor-agent/agent with a
wrapper that points at the bridge (fail-loud, no bypass). CI path triggers
updated for the new files.
2026-09-27 09:48:55 +00:00

82 lines
2.7 KiB
Docker

# Cursor Remote-SSH / personal devbox: OpenSSH + docker CLI (DinD sidecar at runtime).
FROM ubuntu:latest
ARG KUBECTL_VERSION=v1.31.2
ARG FLUX_VERSION=2.9.4
ENV DEBIAN_FRONTEND=noninteractive \
LANG=C.UTF-8
RUN apt-get update && apt-get install -y --no-install-recommends \
bash \
ca-certificates \
chromium \
curl \
docker.io \
git \
golang \
jq \
nodejs \
npm \
openssh-server \
python3 \
python3-venv \
ripgrep \
rustc \
sudo \
unzip \
vim-tiny \
wget \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir -p /var/run/sshd /etc/ssh/sshd_config.d /usr/share/devbox-http \
&& echo 'devbox ok' > /usr/share/devbox-http/index.html
# kubectl (same pattern as services/devops-ai)
RUN curl -fsSL --retry 5 --retry-all-errors --retry-delay 3 \
"https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl" \
-o /usr/local/bin/kubectl \
&& chmod +x /usr/local/bin/kubectl
# flux CLI
RUN curl -fsSL --retry 5 --retry-all-errors --retry-delay 3 \
"https://github.com/fluxcd/flux2/releases/download/v${FLUX_VERSION}/flux_${FLUX_VERSION}_linux_amd64.tar.gz" \
| tar -xz -C /usr/local/bin flux \
&& chmod +x /usr/local/bin/flux
# Passwordless sudo for the interactive developer user.
# Official ubuntu images ship uid 1000 as user "ubuntu" — rename it.
RUN usermod -l developer ubuntu \
&& groupmod -n developer ubuntu \
&& usermod -d /home/developer -m developer \
&& echo 'developer ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/developer \
&& chmod 440 /etc/sudoers.d/developer
# SSH hardening: keys only, no root login.
RUN printf '%s\n' \
'PasswordAuthentication no' \
'KbdInteractiveAuthentication no' \
'PermitRootLogin no' \
'AllowUsers developer' \
'PubkeyAuthentication yes' \
'X11Forwarding no' \
'AllowTcpForwarding yes' \
'ClientAliveInterval 30' \
'ClientAliveCountMax 3' \
> /etc/ssh/sshd_config.d/99-devbox.conf \
&& ssh-keygen -A
RUN curl -L https://github.com/dolthub/dolt/releases/latest/download/install.sh | bash \
&& curl -fsSL https://raw.githubusercontent.com/gastownhall/beads/main/scripts/install.sh | bash
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
# Proxy bridge + cursor-agent proxy wrapper (see file header comments).
COPY devbox-proxy-bridge.js /usr/local/share/devbox/devbox-proxy-bridge.js
COPY cursor-agent-wrapper.sh /usr/local/share/devbox/cursor-agent-wrapper.sh
RUN chmod 755 /usr/local/share/devbox/devbox-proxy-bridge.js /usr/local/share/devbox/cursor-agent-wrapper.sh
EXPOSE 22 8080
USER root
ENTRYPOINT ["/entrypoint.sh"]