android-emulator-container-scripts icon indicating copy to clipboard operation
android-emulator-container-scripts copied to clipboard

How to run the emulator in Docker swarm mode

Open copiltembel opened this issue 4 years ago • 2 comments

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:

  1. -v is not supported by Docker services
  2. --device is not supported by Docker services

Do you have any idea how I could achieve running the emulator in Docker service?

copiltembel avatar Jul 15 '20 10:07 copiltembel

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

pokowaka avatar Jul 16 '20 00:07 pokowaka

Yep, it's really just the devices (/dev/kvm in this case) that don't work.

copiltembel avatar Jul 16 '20 13:07 copiltembel