The purpose of this document is to capture the configuration and setup to run Android on docker on a synology NAS. The purpose of running android is to capture and route notifications via MQTT.
- this is still not done
- I assume you've set up internet access to a VLAN presented to your docker network.
- VLAN 10, which carries subnet 192.168.10.0/24, is our target VLAN.
- https://github.com/Entware/Entware/wiki/Install-on-Synology-NAS
ash-4.4# cat /opt/create_tun.sh
#!/bin/sh
# Create the necessary file structure for /dev/net/tun
if ( [ ! -c /dev/net/tun ] ); then
if ( [ ! -d /dev/net ] ); then
mkdir -m 755 /dev/net
fi
mknod /dev/net/tun c 10 200
chmod 0755 /dev/net/tun
fi
# Load the tun module if not already loaded
if ( !(lsmod | grep -q "^tun\s") ); then
insmod /lib/modules/tun.ko
fi
- create the docker compose file
#vim /volume1/docker/docker-compose-yml/android.yml
version: '3.8'
services:
android:
image: budtmo/docker-android:emulator_14.0
container_name: android_emulator
ports:
- "5037:5037" # ADB server
- "5554:5554" # Emulator console
- "5555:5555" # ADB device
- "6080:6080" # VNC
environment:
- EMULATOR_DEVICE="Samsung Galaxy S10" # Adjust device if necessary
- WEB_VNC=true
- APPIUM=false # Disable Appium if not needed
- AUTO_RECORD=false
volumes:
- /volume1/docker/android/androidusr:/home/androidusr
restart: unless-stopped
networks:
vlan10:
ipv4_address: 192.168.10.90
dns:
- 192.168.1.1
networks:
vlan10:
external: true
#as root
mkdir -p /volume1/docker/android/androidusr
#note the user of the same UID and GID that was identified earlier
chown 1026:100 -R /volume1/docker/android/androidusr
export DOCKER_CLIENT_TIMEOUT=120
export COMPOSE_HTTP_TIMEOUT=120
COMPOSE_HTTP_TIMEOUT=480
docker compose -f /volume1/docker/docker-compose-yml/android.yml up -d
#once it's running, review logs
docker logs -f sabnzbd
#to tshoot bash is available
docker exec -it sabnzbd /bin/bash
### verify that you are accessing the internet via the PIA tunnel
curl ipinfo.io
#or use this https://github.com/transilluminate/check-pia-vpn/blob/main/check-pia-vpn.sh
echo -n "are you NOT using PIA (are you exposed)? "; curl --silent -X POST -H "Content-Type: application/json" -d '{"ipAddress": '`curl --silent https://www.privateinternetaccess.com/site-api/get-location-info | jq .ip`'}' https://www.privateinternetaccess.com/site-api/exposed-check | jq .status
- access http://192.168.20.70:8080 and set language