跳到主要内容

Claude Cage · 面向 Claude 的隔离开发环境,支持桌面工作台、多账号、远程部署与移动端连接。上游 Lee-xeo/Claude-Cage 完整源码镜像,非灵栈原创;主许可 MIT,第三方组件遵循各自许可。来源:https://github.com/Lee-xeo/Claude-Cage 。手动同步,不附带 Release 安装包。

浏览文件

Dockerfile.guest

45 行 · 2.5 KB历史下载
1# The default base is the official Debian 13 multi-platform manifest.
2# A build may select another verified Debian 13 base with BASE_IMAGE.
3ARG BASE_IMAGE=debian:13-slim@sha256:a72b4433de1cf7d6bae0c4cee74d0547f58601a643b3375f070c51600d63b6b2
4FROM ${BASE_IMAGE}
5
6ENV container=docker
7COPY apt-bootstrap.sh /usr/local/lib/cage-apt-bootstrap
8COPY restore-apt-sources.sh /usr/local/lib/cage-image-restore-sources
9ARG DEBIAN_MIRROR=http://deb.debian.org
10RUN sed -i "s#http://deb.debian.org#${DEBIAN_MIRROR}#g" /etc/apt/sources.list.d/debian.sources \
11 && printf '#!/bin/sh\nexit 101\n' > /usr/sbin/policy-rc.d \
12 && chmod 0755 /usr/sbin/policy-rc.d \
13 && sh /usr/local/lib/cage-apt-bootstrap \
14 && apt-get update \
15 && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
16 systemd systemd-sysv dbus dbus-user-session libpam-systemd sudo \
17 openssh-server openssh-client iproute2 fuse3 sshfs socat \
18 ca-certificates curl git jq python3 python3-apt zsh procps \
19 && rm /usr/sbin/policy-rc.d \
20 && rm -rf /var/lib/apt/lists/* \
21 && useradd --create-home --uid 1000 --user-group --shell /bin/bash cage \
22 && printf 'cage ALL=(ALL) NOPASSWD: ALL\n' > /etc/sudoers.d/cage \
23 && chmod 0440 /etc/sudoers.d/cage \
24 && printf 'user_allow_other\n' > /etc/fuse.conf \
25 && install -d -m 0700 -o cage -g cage /home/cage/.ssh \
26 && install -d -m 0755 /etc/systemd/system.conf.d \
27 && printf '[Manager]\nDefaultTasksMax=infinity\n' > /etc/systemd/system.conf.d/90-cage-container.conf \
28 && install -d -m 0755 /etc/ssh/sshd_config.d /etc/systemd/system/ssh.service.d \
29 && printf '%s\n' 'PermitRootLogin no' 'PasswordAuthentication no' \
30 'KbdInteractiveAuthentication no' 'AuthenticationMethods publickey' \
31 'AuthorizedKeysFile /etc/ssh/cage_authorized_keys' 'AllowTcpForwarding yes' \
32 'GatewayPorts no' 'X11Forwarding no' 'AllowUsers cage' \
33 > /etc/ssh/sshd_config.d/10-cage.conf \
34 && printf '[Service]\nExecStartPre=\nExecStartPre=/usr/bin/ssh-keygen -A\nExecStartPre=/usr/sbin/sshd -t\n' \
35 > /etc/systemd/system/ssh.service.d/10-cage-hostkeys.conf \
36 && systemctl enable ssh.service \
37 && rm -f /etc/ssh/ssh_host_* /etc/machine-id /var/lib/dbus/machine-id \
38 && touch /etc/machine-id \
39 && ln -s /etc/machine-id /var/lib/dbus/machine-id \
40 && sh /usr/local/lib/cage-image-restore-sources
41
42# PID 1 owns its services. Container stop must let systemd stop them in order.
43# Persistent files remain in the same container until an explicit migration.
44STOPSIGNAL SIGRTMIN+3
45CMD ["/sbin/init"]