跳到主要内容

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

浏览文件

docker-rootful.yaml

90 行 · 3.3 KB历史下载
1# A template to use Docker (rootful) instead of containerd & nerdctl
2# $ limactl start ./docker-rootful.yaml
3# $ limactl shell docker-roootful docker run -it -v $HOME:$HOME --rm alpine
4
5# To run `docker` on the host (assumes docker-cli is installed):
6# $ export DOCKER_HOST=$(limactl list docker-rootful --format 'unix://{{.Dir}}/sock/docker.sock')
7# $ docker ...
8
9minimumLimaVersion: 2.0.0
10
11base:
12- template:_images/ubuntu-lts
13- template:_default/mounts
14
15# containerd is managed by Docker, not by Lima, so the values are set to false here.
16containerd:
17 system: false
18 user: false
19provision:
20- mode: system
21 # This script defines the host.docker.internal hostname when hostResolver is disabled.
22 # It is also needed for lima 0.8.2 and earlier, which does not support hostResolver.hosts.
23 # Names defined in /etc/hosts inside the VM are not resolved inside containers when
24 # using the hostResolver; use hostResolver.hosts instead (requires lima 0.8.3 or later).
25 script: |
26 #!/bin/sh
27 sed -i 's/host.lima.internal.*/host.lima.internal host.docker.internal/' /etc/hosts
28- mode: system
29 script: |
30 #!/bin/bash
31 set -eux -o pipefail
32 command -v docker >/dev/null 2>&1 && exit 0
33 export DEBIAN_FRONTEND=noninteractive
34 curl -fsSL https://get.docker.com | sh
35- mode: yq
36 path: /etc/systemd/system/docker.socket.d/override.conf
37 format: ini
38 expression: .Socket.SocketUser="{{.User}}"
39- mode: yq
40 path: "/etc/docker/daemon.json"
41 expression: |
42 .features.cdi = true |
43 .features.containerd-snapshotter = {{.Param.containerdSnapshotter}}
44probes:
45- script: |
46 #!/bin/bash
47 set -eux -o pipefail
48 if ! timeout 30s bash -c "until command -v docker >/dev/null 2>&1; do sleep 3; done"; then
49 echo >&2 "docker is not installed yet"
50 exit 1
51 fi
52 if ! timeout 30s bash -c "until pgrep dockerd; do sleep 3; done"; then
53 echo >&2 "dockerd is not running"
54 exit 1
55 fi
56 hint: See "/var/log/cloud-init-output.log" in the guest
57hostResolver:
58 # hostResolver.hosts requires lima 0.8.3 or later. Names defined here will also
59 # resolve inside containers, and not just inside the VM itself.
60 hosts:
61 host.docker.internal: host.lima.internal
62portForwards:
63- guestSocket: "/var/run/docker.sock"
64 hostSocket: "{{.Dir}}/sock/docker.sock"
65message: |
66 To run `docker` on the host (assumes docker-cli is installed), run the following commands:
67 ------
68 docker context create lima-{{.Name}} --docker "host=unix://{{.Dir}}/sock/docker.sock"
69 docker context use lima-{{.Name}}
70 docker run hello-world
71 ------
72 {{- if .Instance.Config.VMOpts.vz.rosetta.enabled}}
73 Rosetta is enabled in this VM, so you can run x86_64 containers on Apple Silicon.
74 You can use Rosetta AOT Caching with the CDI spec:
75 - To run a container, add `--device=lima-vm.io/rosetta=cached` to your `docker run` command:
76 ------
77 docker run --platform=linux/amd64 --device=lima-vm.io/rosetta=cached ...
78 ------
79 - To build an image, add `# syntax=docker/dockerfile:1-labs` at the top of your Dockerfile,
80 and use `--device=lima-vm.io/rosetta=cached` in the `RUN` command:
81 ------
82 # syntax=docker/dockerfile:1-labs
83 FROM ...
84 ...
85 RUN --device=lima-vm.io/rosetta=cached <your amd64 command>
86 ------
87 See: https://lima-vm.io/docs/config/multi-arch/#rosetta-aot-caching
88 {{- end}}
89param:
90 containerdSnapshotter: true