2020-06-18 15:08:48 +01:00
VNC pass
--------
Passing ```VNC_PASSWORD="your_pass_here"``` will secure your vnc connection.
2018-09-04 11:01:47 +01:00
Proxy
-----
2019-07-05 08:37:19 +01:00
You can enable proxy inside container and Android emulator by passing following environment variables:
2018-09-04 11:01:47 +01:00
2019-07-05 08:37:19 +01:00
- HTTP_PROXY="http://\<docker\_bridge\_ip>:< port > "
- HTTPS_PROXY=""http://\<docker\_bridge\_ip>:< port > "
2018-09-04 11:01:47 +01:00
- NO_PROXY="localhost"
2019-07-05 08:37:19 +01:00
- ENABLE_PROXY_ON_EMULATOR=true
2018-09-04 11:01:47 +01:00
Language
--------
You can change the language setting of Android Emulator on the fly by passing following environment variable:
- LANGUAGE="\<language>"
- COUNTRY="\<country>"
2019-11-20 14:28:09 +00:00
Data partition size
-------------------
The size of the data partition can be set by passing the following environment variable:
- DATAPARTITION="\<size>"
The value can be specified in the same format that is used by the emulator config file (`disk.dataPartition.size`), e.g. `800m` .
2018-09-14 14:37:00 +01:00
Camera
------
Passing following environment variable to be able to connect laptop / pc camera to Android emulator:
- EMULATOR_ARGS="-camera-back webcam0"
2020-03-09 16:11:36 +00:00
Custom Avd name Arguments
-------------------------
Passing following environment variable to set a custom avd name
- AVD_NAME="customName"
2018-09-04 11:01:47 +01:00
Custom Emulator Arguments
-------------------------
If you want to add more arguments for running emulator, you can ** *pass an environment variable EMULATOR_ARGS*** while running docker command.
```bash
2019-01-30 13:58:31 +00:00
docker run --privileged -d -p 6080:6080 -p 4723:4723 -p 5554:5554 -p 5555:5555 -e DEVICE="Samsung Galaxy S6" -e EMULATOR_ARGS="-no-snapshot-load -partition-size 512" --name android-container budtmo/docker-android-x86-8.1
2018-09-04 11:01:47 +01:00
```
2019-07-10 08:36:18 +01:00
Appium Test Distribution (ATD)
------------------------------
You can enable [ATD ](https://github.com/AppiumTestDistribution/AppiumTestDistribution ) by passing environment variable ATD=true and bind the port to the host, e.g. -p 4567:4567
2019-03-01 11:46:50 +00:00
SaltStack
---------
You can enable [SaltStack ](https://github.com/saltstack/salt ) to control running containers by passing environment variable SALT_MASTER=< ip_address_of_salt_master > .
2018-09-04 11:01:47 +01:00
Back & Restore
--------------
If you want to backup/reuse the avds created with furture upgrades or for replication, run the container with two extra mounts
- -v local_backup/.android:/root/.android
- -v local_backup/android_emulator:/root/android_emulator
```bash
2019-07-20 10:45:14 +01:00
docker run --privileged -d -p 6080:6080 -p 4723:4723 -p 5554:5554 -p 5555:5555 -v local_backup/.android:/root/.android -v local_backup/android_emulator:/root/android_emulator -e DEVICE="Nexus 5" --name android-container budtmo/docker-android-x86-8.1
2018-09-04 11:01:47 +01:00
```
For the first run, this will create a new avd and all the changes will be accessible in the `local_backup` directory. Now for all future runs, it will reuse the avds. Even this should work with new releases of `docker-android`
2020-06-26 15:01:12 +01:00
Nginx
-----
2020-07-01 10:06:05 +01:00
You can have 1 nginx service to handle multiple containers. Sample nginx configuration is [this ](nginx/default ) and sample call is ```http://127.0.0.1/container-1/?nginx=& path=/container-1/websockify& view_only=true& password=secr3t```