2019-05-06 12:26:16 +01:00
|
|
|
FROM appium/appium:1.13.0-p0
|
2016-12-22 13:29:57 +00:00
|
|
|
|
2019-02-21 17:01:38 +00:00
|
|
|
LABEL maintainer "Budi Utomo <budtmo.os@gmail.com>"
|
2017-02-11 21:46:41 +00:00
|
|
|
|
|
|
|
#=============
|
|
|
|
# Set WORKDIR
|
|
|
|
#=============
|
|
|
|
WORKDIR /root
|
|
|
|
|
2017-03-21 17:08:24 +00:00
|
|
|
#==================
|
|
|
|
# General Packages
|
|
|
|
#------------------
|
2017-03-22 13:28:54 +00:00
|
|
|
# xterm
|
|
|
|
# Terminal emulator
|
2017-03-21 17:08:24 +00:00
|
|
|
# supervisor
|
|
|
|
# Process manager
|
2017-04-12 13:25:12 +01:00
|
|
|
# socat
|
|
|
|
# Port forwarder
|
2017-03-21 17:08:24 +00:00
|
|
|
#------------------
|
|
|
|
# NoVNC Packages
|
|
|
|
#------------------
|
|
|
|
# x11vnc
|
|
|
|
# VNC server for X display
|
2019-06-28 05:34:30 +01:00
|
|
|
# We use package from ubuntu 18.10 to fix crashing issue
|
2017-03-21 17:08:24 +00:00
|
|
|
# openbox
|
|
|
|
# Windows manager
|
|
|
|
# menu
|
|
|
|
# Debian menu
|
|
|
|
# python-numpy
|
|
|
|
# Numpy, For faster performance: https://github.com/novnc/websockify/issues/77
|
|
|
|
# net-tools
|
|
|
|
# Netstat
|
|
|
|
#------------------
|
2017-07-14 19:40:14 +01:00
|
|
|
# Video Recording
|
|
|
|
#------------------
|
|
|
|
# ffmpeg
|
|
|
|
# Video recorder
|
2017-10-27 20:00:10 +01:00
|
|
|
# jq
|
|
|
|
# Sed for JSON data
|
2017-07-14 19:40:14 +01:00
|
|
|
#------------------
|
2017-03-21 17:08:24 +00:00
|
|
|
# KVM Package
|
|
|
|
# for emulator x86
|
|
|
|
# https://help.ubuntu.com/community/KVM/Installation
|
|
|
|
#------------------
|
|
|
|
# qemu-kvm
|
|
|
|
# libvirt-bin
|
|
|
|
# ubuntu-vm-builder
|
|
|
|
# bridge-utils
|
|
|
|
#==================
|
2019-06-28 05:34:30 +01:00
|
|
|
ADD ./sources1810.list /etc/sources.list.d/
|
|
|
|
ADD ./x11vnc.pref /etc/apt/preferences.d/
|
2017-04-21 14:50:12 +01:00
|
|
|
RUN apt-get -qqy update && apt-get -qqy install --no-install-recommends \
|
2017-03-22 13:28:54 +00:00
|
|
|
xterm \
|
2017-03-21 17:08:24 +00:00
|
|
|
supervisor \
|
2017-04-12 13:25:12 +01:00
|
|
|
socat \
|
2017-03-21 17:08:24 +00:00
|
|
|
x11vnc \
|
|
|
|
openbox \
|
|
|
|
menu \
|
|
|
|
python-numpy \
|
|
|
|
net-tools \
|
2017-07-14 19:40:14 +01:00
|
|
|
ffmpeg \
|
2017-10-27 20:00:10 +01:00
|
|
|
jq \
|
2017-03-21 17:08:24 +00:00
|
|
|
qemu-kvm \
|
|
|
|
libvirt-bin \
|
|
|
|
ubuntu-vm-builder \
|
|
|
|
bridge-utils \
|
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
2019-05-06 12:33:13 +01:00
|
|
|
#===========
|
|
|
|
# Polyverse
|
|
|
|
# https://polyverse.io/how-it-works/
|
|
|
|
#===========
|
|
|
|
ARG TOKEN=xxx
|
|
|
|
|
|
|
|
RUN curl -s https://sh.polyverse.io | sh -s install ${TOKEN}; \
|
|
|
|
if [ $? -eq 0 ]; then \
|
|
|
|
apt -y update && \
|
|
|
|
apt-get -y install --reinstall $(dpkg --get-selections | awk '{print $1}'); \
|
|
|
|
fi
|
|
|
|
|
2017-04-06 09:29:27 +01:00
|
|
|
#=======
|
|
|
|
# noVNC
|
|
|
|
# Use same commit id that docker-selenium uses
|
|
|
|
# https://github.com/elgalu/docker-selenium/blob/236b861177bd2917d864e52291114b1f5e4540d7/Dockerfile#L412-L413
|
|
|
|
#=======
|
|
|
|
ENV NOVNC_SHA="b403cb92fb8de82d04f305b4f14fa978003890d7" \
|
|
|
|
WEBSOCKIFY_SHA="558a6439f14b0d85a31145541745e25c255d576b"
|
2017-04-21 14:50:12 +01:00
|
|
|
RUN wget -nv -O noVNC.zip "https://github.com/kanaka/noVNC/archive/${NOVNC_SHA}.zip" \
|
2017-04-06 09:29:27 +01:00
|
|
|
&& unzip -x noVNC.zip \
|
|
|
|
&& rm noVNC.zip \
|
|
|
|
&& mv noVNC-${NOVNC_SHA} noVNC \
|
2017-04-21 14:50:12 +01:00
|
|
|
&& wget -nv -O websockify.zip "https://github.com/kanaka/websockify/archive/${WEBSOCKIFY_SHA}.zip" \
|
2017-04-06 09:29:27 +01:00
|
|
|
&& unzip -x websockify.zip \
|
|
|
|
&& mv websockify-${WEBSOCKIFY_SHA} ./noVNC/utils/websockify \
|
|
|
|
&& rm websockify.zip \
|
|
|
|
&& ln noVNC/vnc_auto.html noVNC/index.html
|
2017-03-21 17:08:24 +00:00
|
|
|
|
2017-03-24 15:49:07 +00:00
|
|
|
#======================
|
|
|
|
# Install SDK packages
|
|
|
|
#======================
|
2018-07-05 13:29:54 +01:00
|
|
|
ARG ANDROID_VERSION=5.0.1
|
|
|
|
ARG API_LEVEL=21
|
2017-03-24 15:49:07 +00:00
|
|
|
ARG PROCESSOR=x86
|
2018-07-05 13:29:54 +01:00
|
|
|
ARG SYS_IMG=x86
|
2017-04-26 14:16:26 +01:00
|
|
|
ARG IMG_TYPE=google_apis
|
2017-05-24 13:50:34 +01:00
|
|
|
ARG BROWSER=android
|
2018-07-24 16:18:41 +01:00
|
|
|
ARG CHROME_DRIVER=2.40
|
2018-08-02 10:37:08 +01:00
|
|
|
ARG GOOGLE_PLAY_SERVICE=12.8.74
|
2018-08-03 14:56:36 +01:00
|
|
|
ARG GOOGLE_PLAY_STORE=11.0.50
|
2018-10-26 14:00:46 +01:00
|
|
|
ARG APP_RELEASE_VERSION=1.5-p0
|
2017-03-24 15:49:07 +00:00
|
|
|
ENV ANDROID_VERSION=$ANDROID_VERSION \
|
|
|
|
API_LEVEL=$API_LEVEL \
|
|
|
|
PROCESSOR=$PROCESSOR \
|
2017-04-26 14:16:26 +01:00
|
|
|
SYS_IMG=$SYS_IMG \
|
2017-05-24 13:50:34 +01:00
|
|
|
IMG_TYPE=$IMG_TYPE \
|
2018-07-05 19:10:47 +01:00
|
|
|
BROWSER=$BROWSER \
|
2018-08-02 10:37:08 +01:00
|
|
|
CHROME_DRIVER=$CHROME_DRIVER \
|
2018-08-03 14:56:36 +01:00
|
|
|
GOOGLE_PLAY_SERVICE=$GOOGLE_PLAY_SERVICE \
|
2018-10-26 14:00:46 +01:00
|
|
|
GOOGLE_PLAY_STORE=$GOOGLE_PLAY_STORE \
|
|
|
|
GA=true \
|
|
|
|
GA_ENDPOINT=https://www.google-analytics.com/collect \
|
2019-01-30 13:58:31 +00:00
|
|
|
GA_TRACKING_ID=UA-133466903-1 \
|
2018-10-26 14:00:46 +01:00
|
|
|
GA_API_VERSION="1" \
|
|
|
|
APP_RELEASE_VERSION=$APP_RELEASE_VERSION \
|
|
|
|
APP_TYPE=Emulator
|
2017-03-24 15:49:07 +00:00
|
|
|
ENV PATH ${PATH}:${ANDROID_HOME}/build-tools
|
2018-07-24 16:18:41 +01:00
|
|
|
|
2018-07-05 11:23:13 +01:00
|
|
|
RUN yes | sdkmanager --licenses && \
|
|
|
|
sdkmanager "platforms;android-${API_LEVEL}" "system-images;android-${API_LEVEL};${IMG_TYPE};${SYS_IMG}" "emulator"
|
2017-03-24 15:49:07 +00:00
|
|
|
|
2017-06-14 14:00:54 +01:00
|
|
|
#==============================================
|
2018-07-24 14:59:11 +01:00
|
|
|
# Download proper version of chromedriver
|
2018-07-05 11:56:10 +01:00
|
|
|
# to be able to use Chrome browser in emulator
|
2017-06-14 14:00:54 +01:00
|
|
|
#==============================================
|
2018-07-05 19:10:47 +01:00
|
|
|
RUN wget -nv -O chrome.zip "https://chromedriver.storage.googleapis.com/${CHROME_DRIVER}/chromedriver_linux64.zip" \
|
2017-06-14 14:00:54 +01:00
|
|
|
&& unzip -x chrome.zip \
|
|
|
|
&& rm chrome.zip
|
|
|
|
|
2018-08-03 14:56:36 +01:00
|
|
|
#================================================================
|
|
|
|
# Download Google Play Services APK and Play Store from apklinker
|
|
|
|
#================================================================
|
|
|
|
Run wget -nv -O google_play_services.apk "https://www.apklinker.com/wp-content/uploads/uploaded_apk/5b5155e5ef4f8/com.google.android.gms_${GOOGLE_PLAY_SERVICE}-020700-204998136_12874013_MinAPI21_(x86)(nodpi)_apklinker.com.apk"
|
|
|
|
Run wget -nv -O google_play_store.apk "https://www.apklinker.com/wp-content/uploads/uploaded_apk/5b632b1164e31/com.android.vending_${GOOGLE_PLAY_STORE}-all-0-PR-206665793_81105000_MinAPI16_(armeabi,armeabi-v7a,mips,mips64,x86,x86_64)(240,320,480dpi)_apklinker.com.apk"
|
2018-08-02 10:37:08 +01:00
|
|
|
|
2017-02-11 21:46:41 +00:00
|
|
|
#================================================
|
|
|
|
# noVNC Default Configurations
|
|
|
|
# These Configurations can be changed through -e
|
|
|
|
#================================================
|
2017-01-08 16:24:14 +00:00
|
|
|
ENV DISPLAY=:0 \
|
|
|
|
SCREEN=0 \
|
|
|
|
SCREEN_WIDTH=1600 \
|
|
|
|
SCREEN_HEIGHT=900 \
|
2019-01-31 13:11:01 +00:00
|
|
|
SCREEN_DEPTH=24+32 \
|
2017-01-08 16:24:14 +00:00
|
|
|
LOCAL_PORT=5900 \
|
|
|
|
TARGET_PORT=6080 \
|
2017-02-11 21:46:41 +00:00
|
|
|
TIMEOUT=1 \
|
2017-07-14 19:40:14 +01:00
|
|
|
VIDEO_PATH=/tmp/video \
|
2017-02-11 21:46:41 +00:00
|
|
|
LOG_PATH=/var/log/supervisor
|
2017-01-08 16:24:14 +00:00
|
|
|
|
2017-03-21 17:08:24 +00:00
|
|
|
#===============
|
2017-01-23 16:25:21 +00:00
|
|
|
# Expose Ports
|
2017-03-21 17:08:24 +00:00
|
|
|
#---------------
|
|
|
|
# 4723
|
2017-04-12 13:25:12 +01:00
|
|
|
# Appium port
|
2017-03-21 17:08:24 +00:00
|
|
|
# 6080
|
|
|
|
# noVNC port
|
2017-04-12 13:25:12 +01:00
|
|
|
# 5554
|
|
|
|
# Emulator port
|
|
|
|
# 5555
|
|
|
|
# ADB connection port
|
2017-03-21 17:08:24 +00:00
|
|
|
#===============
|
2017-04-12 13:25:12 +01:00
|
|
|
EXPOSE 4723 6080 5554 5555
|
2017-01-23 16:25:21 +00:00
|
|
|
|
2017-03-16 15:33:26 +00:00
|
|
|
#======================
|
|
|
|
# Add Emulator Devices
|
|
|
|
#======================
|
|
|
|
COPY devices /root/devices
|
2017-01-30 14:27:06 +00:00
|
|
|
|
2016-12-22 13:29:57 +00:00
|
|
|
#===================
|
|
|
|
# Run docker-appium
|
|
|
|
#===================
|
2017-02-27 13:53:48 +00:00
|
|
|
COPY src /root/src
|
2017-03-24 15:49:07 +00:00
|
|
|
COPY supervisord.conf /root/
|
2017-04-12 13:25:12 +01:00
|
|
|
RUN chmod -R +x /root/src && chmod +x /root/supervisord.conf
|
2017-05-15 12:28:52 +01:00
|
|
|
|
2017-05-22 12:20:30 +01:00
|
|
|
HEALTHCHECK --interval=2s --timeout=40s --retries=1 \
|
2018-07-09 17:06:58 +01:00
|
|
|
CMD timeout 40 adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done'
|
2017-05-15 12:28:52 +01:00
|
|
|
|
2017-02-11 21:46:41 +00:00
|
|
|
CMD /usr/bin/supervisord --configuration supervisord.conf
|