A Docker Desktop extension that exposes USB-connected iOS devices to Docker containers.
10K+
A Docker Desktop extension that exposes USB-connected iOS devices to Docker containers via the usbmuxd protocol.
Note: This extension works on macOS and Windows. Linux is not supported (Docker runs natively on Linux, so you can access usbmuxd directly).
This extension creates a bridge between the host's usbmuxd daemon and Docker containers, allowing tools like go-ios, pymobiledevice3, libimobiledevice, and other iOS automation tools to communicate with physical iOS devices from within containers.
┌─────────────────────────────────────────────────────────────────┐
│ macOS Host │
│ │
│ iPhone ──USB──► /var/run/usbmuxd │
│ │ │
│ mobile-relay (TCP :27015) │
│ + tunnel manager (:60105) │
│ │ │
└────────────────────────┼────────────────────────────────────────┘
│ host.docker.internal:27015
┌────────────────────────┼────────────────────────────────────────┐
│ Docker Desktop VM ▼ │
│ ┌─────────────────┐ │
│ │ usbmuxd-backend │ │
│ └────────┬────────┘ │
│ │ │
│ ▼ │
│ /run/guest-services/.../usbmuxd.sock │
│ │ │
│ ┌────────────────────┼────────────────────────────────────────┐│
│ │ Your Container │ ││
│ │ ▼ ││
│ │ /var/run/usbmuxd (volume mount) ││
│ │ ││
│ │ go-ios, pymobiledevice3, libimobiledevice, etc. ││
│ └─────────────────────────────────────────────────────────────┘│
└─────────────────────────────────────────────────────────────────┘
# Clone the repository
git clone https://github.com/aluedeke/mobile-docker-extension.git
cd mobile-docker-extension
# Build and install
make install
docker extension install aluedeke/mobile-docker-extension
The host relay must be running to bridge connections. You can start it from:
# If installed via extension
~/.docker/extensions/aluedeke_mobile-docker-extension/host/darwin/mobile-relay
# Or build and run locally
make run-host
Mount the usbmuxd socket into your container at /var/run/usbmuxd:
services:
ios-automation:
image: your-image
volumes:
- /run/guest-services/aluedeke_mobile-docker-extension/usbmuxd.sock:/var/run/usbmuxd
docker run -v /run/guest-services/aluedeke_mobile-docker-extension/usbmuxd.sock:/var/run/usbmuxd your-image
Once configured, iOS tools work as if running on the host:
# List connected devices with go-ios
docker run --rm \
-v /run/guest-services/aluedeke_mobile-docker-extension/usbmuxd.sock:/var/run/usbmuxd \
ghcr.io/danielpaulus/go-ios:latest list
# Use pymobiledevice3
docker run --rm \
-v /run/guest-services/aluedeke_mobile-docker-extension/usbmuxd.sock:/var/run/usbmuxd \
python:3.12-slim sh -c "pip install pymobiledevice3 && pymobiledevice3 usbmux list"
For go-ios iOS 17.4+ features that require tunnels, add the tunnel agent environment variables:
services:
go-ios:
image: ghcr.io/danielpaulus/go-ios:latest
volumes:
- /run/guest-services/aluedeke_mobile-docker-extension/usbmuxd.sock:/var/run/usbmuxd
environment:
- GO_IOS_AGENT_HOST=host.docker.internal
- GO_IOS_AGENT_PORT=60105
Note: pymobiledevice3 handles tunnels transparently over the usbmuxd socket and doesn't need these environment variables.
See the example directories for complete working examples:
# Using go-ios
docker run --rm \
-v /run/guest-services/aluedeke_mobile-docker-extension/usbmuxd.sock:/var/run/usbmuxd \
ghcr.io/danielpaulus/go-ios:latest list
# Using pymobiledevice3
cd examples/pymobiledevice3
docker compose build
docker compose run --rm pymobiledevice3 usbmux list
pgrep -f mobile-relaylsof -i :27015ls -la /run/guest-services/aluedeke_mobile-docker-extension/ls -la /var/run/usbmuxdsystemctl status usbmuxdidevice_id -l (on host)GO_IOS_AGENT_HOST and GO_IOS_AGENT_PORT environment variables are set# Build everything
make build
# Build just the host binary
make build-host
# Build just the backend
make build-backend
# Run the full test suite
./test.sh
# Test socket connectivity
make test-socket
# Enable extension debug mode
make debug
# View logs
make logs
# Reset debug mode
make reset
Host Relay (mobile-relay): A Go binary that runs on the host, listens on TCP port 27015, and forwards connections to the real /var/run/usbmuxd socket. Also includes a tunnel manager on port 60105 for iOS 17.4+ devices (go-ios compatible).
Backend Service (usbmuxd-backend): Runs inside the Docker Desktop VM. Creates a Unix socket that proxies connections to the host relay. Provides an API for the extension UI.
Container Configuration: Containers mount the backend's Unix socket at /var/run/usbmuxd. iOS tools use this standard location automatically.
MIT
Content type
Image
Digest
sha256:87b2a5e85…
Size
17.7 MB
Last updated
8 months ago
docker pull aluedeke/mobile-docker-extension