android-emulator-container-scripts
android-emulator-container-scripts copied to clipboard
How to run the emulator in Docker swarm mode
I have tried running the image created by this script using a Docker service:
$ docker service create --replicas 1 --name t1 -e DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix -e "EMULATOR_PARAMS=-gpu host" --device /dev/kvm --publish 8554:8554/tcp --publish 5555:5555/tcp q-google-x86-gpu:30.0.12
But there are multiple problems:
- -v is not supported by Docker services
- --device is not supported by Docker services
Do you have any idea how I could achieve running the emulator in Docker service?
It looks like there are 2 challenges:
- enable /dev/kvm: not sure how to do this. There seems to be some issues that are still open: https://github.com/docker/swarmkit/issues/2682
- enable gpu. use
--mount type=bind,src=/tmp/.X11-unix,dst=/tmp/.X11-unix
Yep, it's really just the devices (/dev/kvm in this case) that don't work.