Перейти к содержимому

Docker provider

Run Android redroid sessions as Docker containers on one or more Linux (x86_64 or arm64) hosts or Apple Silicon Macs without Kubernetes.

Это содержимое пока не доступно на вашем языке.

The provider-docker service implements the same Provider contract as provider-emulator, running each Android session as Docker containers (redroid, the device agent and an optional sing-box VPN sidecar) directly against the Docker Engine API on a Linux (x86_64 or arm64) host or an Apple Silicon Mac inside a Lima VM. To scale across multiple Docker hosts, run one provider-docker per host and list all of them under providers in the api config.

For a ready-to-run setup with local storage, disabled auth and preconfigured Chromium + Holtdroid WebView builds, see Docker Compose.

listen: ":8080"
host: "" # empty: DOCKER_HOST or unix:///var/run/docker.sock
network: holtdroid # Docker bridge network shared with api; empty auto-detects
hostName: "" # prefix for slot IDs and Inventory card name; empty: Docker daemon name
slots: 2
names: [] # optional human labels for slots 1..N (e.g. [Fox, Owl])
image: ghcr.io/holtdroid/holtdroid-session:main
imagePullPolicy: IfNotPresent # IfNotPresent | Always | Never
agentPort: 18580
tunnelPort: 18581
redroid:
images: # Android version → image; the newest is the default
"15": ghcr.io/holtdroid/holtdroid-redroid:15
screens: [] # built-in presets; see Emulator provider → Screens
fps: 60
gpu: /dev/dri/renderD128 # empty: software rendering (guest mode)
dataSize: 8Gi
shell: allowlist # allowlist | full | off
privileged: false # true: run Android container privileged
args: [] # extra redroid boot arguments
resources: # Android container limits
limits: { memory: 3Gi }
agentResources:
limits: { memory: 1Gi }
vpn:
locations: [] # same format as provider-emulator; empty disables VPN sidecar
stateFile: /var/lib/holtdroid/docker-state.json # optional; empty keeps mutable state in memory
hostCgroup: /sys/fs/cgroup # mounted read-only into agent for device load metrics; empty disables
Key Meaning
host Docker Engine endpoint (unix:///var/run/docker.sock, tcp://…, http://…). Empty uses DOCKER_HOST or unix:///var/run/docker.sock.
network Docker bridge network that session containers join so the api (and optional ssh-gateway) can reach them by container IP. When empty, provider-docker inspects its own container and joins its user-defined bridge network (falling back to bridge).
hostName Machine name shown on the Inventory page (Slot.group) and prefix of slot IDs (<hostName>-1, …). Defaults to Docker’s daemon name.
slots Fixed number of concurrent sessions on this host (default 2).
names Optional labels shown for slots 1..N instead of <hostName>-1, <hostName>-2, …
image, imagePullPolicy Session agent image (ghcr.io/holtdroid/holtdroid-session:main) and pull policy (IfNotPresent, Always, Never), applied to the redroid and sing-box images too. Missing images are pulled asynchronously while the UI shows provisioning progress.
agentPort, tunnelPort Ports the agent listens on inside the session network namespace (defaults 18580 and 18581).
redroid.images Android version → redroid image map (ghcr.io/holtdroid/holtdroid-redroid:<version>). Supports Android 11–16 on x86_64 and Android 12–16 on arm64; the newest configured version is the default.
redroid.gpu Host DRI render node (default /dev/dri/renderD128). If the configured node does not exist on the Docker host (headless servers, arm64 hosts or VMs), provider-docker logs a warning and falls back to androidboot.redroid_gpu_mode=guest automatically; set "" to request software rendering explicitly.
redroid.privileged false (default): drops all capabilities except the set Android needs (plus MKNOD for dynamic /dev/block/loopN nodes), applies Docker’s default seccomp profile plus userfaultfd, sets cgroupns: private, maps /dev/null to /dev/kmsg and sets device_cgroup_rules for loop and binder devices directly — no NRI plugin needed. true: runs the Android container privileged.
redroid.shell, screens, fps, dataSize, args Shared with provider-emulator.
resources, agentResources Memory and optional CPU limits (limits.memory, limits.cpu) applied as Docker container limits. Leave cpu unset so busy sessions can borrow idle cores.
vpn Same vpn section as provider-emulator. When locations are configured, provider-docker starts a sing-box container on network, uploads the rendered config.json into it via the Docker archive API before starting, and joins both android and agent to its network namespace (network_mode: container:<vpn>).
stateFile Optional JSON file persisting maintenance holds, lastActivity timestamps and in-place swapped artifactRefs across restarts (Docker container labels are immutable). Running sessions themselves always survive restarts through their container labels.
hostCgroup Host cgroup v2 directory mounted read-only at /host/cgroup in the agent container so the session Device card shows Android’s container CPU and memory usage. Set to "" to disable.

Each session is a group of containers labelled holtdroid.managed-by=holtdroid-provider-docker and holtdroid.session=<id> plus a named /data volume holtdroid-data-<id>:

  • Without VPN: holtdroid-session-<id>-android joins network and owns the network namespace; holtdroid-session-<id>-agent joins it via network_mode: container:<android>.
  • With VPN: holtdroid-session-<id>-vpn (sing-box) joins network and owns the network namespace; both android and agent join it via network_mode: container:<vpn>.

Stopping or reaping a session removes all containers and the /data volume carrying its session label.

  • Linux x86_64 or arm64 with CONFIG_ANDROID_BINDERFS in the kernel (grep -w binder /proc/devices), or Apple Silicon macOS via Lima (deploy/docker/lima-holtdroid.yaml). On arm64, provider-docker advertises native arm64-v8a only (Android 12–16 _64only images).
  • Docker Engine 25+ (Engine API v1.44+).
  • Docker socket = root on the host. provider-docker needs access to /var/run/docker.sock, and Android containers still share the host kernel. Run sessions on a dedicated host for trusted users — see Emulator security.