2018-05-12 12:13:21 +01:00
|
|
|
FROM appium/appium:1.8.0-p1
|
2016-12-22 13:29:57 +00:00
|
|
|
|
2017-06-14 14:00:54 +01:00
|
|
|
LABEL maintainer "Budi Utomo <budi.ut.1989@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
|
|
|
|
# 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
|
|
|
|
#==================
|
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/*
|
|
|
|
|
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
|
|
|
|
#======================
|
|
|
|
ARG ANDROID_VERSION=5.0.1
|
|
|
|
ARG API_LEVEL=21
|
|
|
|
ARG PROCESSOR=x86
|
|
|
|
ARG SYS_IMG=x86_64
|
2017-04-26 14:16:26 +01:00
|
|
|
ARG IMG_TYPE=google_apis
|
2017-05-24 13:50:34 +01:00
|
|
|
ARG BROWSER=android
|
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 \
|
|
|
|
BROWSER=$BROWSER
|
2017-03-24 15:49:07 +00:00
|
|
|
ENV PATH ${PATH}:${ANDROID_HOME}/build-tools
|
2017-11-07 16:33:22 +00:00
|
|
|
RUN echo y | sdkmanager "platforms;android-${API_LEVEL}" && \
|
|
|
|
echo y | sdkmanager "system-images;android-${API_LEVEL};${IMG_TYPE};${SYS_IMG}" && \
|
|
|
|
echo y | sdkmanager "emulator"
|
2017-07-18 13:06:41 +01:00
|
|
|
RUN rm ${ANDROID_HOME}/tools/emulator \
|
|
|
|
&& ln -s ${ANDROID_HOME}/emulator/emulator64-${PROCESSOR} ${ANDROID_HOME}/tools/emulator
|
|
|
|
ENV LD_LIBRARY_PATH=$ANDROID_HOME/emulator/lib64:$ANDROID_HOME/emulator/lib64/qt/lib
|
|
|
|
|
2017-03-24 15:49:07 +00:00
|
|
|
|
2017-06-14 14:00:54 +01:00
|
|
|
#==============================================
|
|
|
|
# Download chrome driver v2.26
|
|
|
|
# to be able to use chrome browser in emulator
|
|
|
|
# Issue: https://github.com/butomo1989/docker-android/commit/6406504f944dae73d0a0c5d8e71a17a47dff9b33
|
|
|
|
#==============================================
|
|
|
|
RUN wget -nv -O chrome.zip "https://chromedriver.storage.googleapis.com/2.26/chromedriver_linux64.zip" \
|
|
|
|
&& unzip -x chrome.zip \
|
|
|
|
&& rm chrome.zip
|
|
|
|
|
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 \
|
|
|
|
SCREEN_DEPTH=16 \
|
|
|
|
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 \
|
2017-05-15 12:28:52 +01:00
|
|
|
CMD adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done'
|
|
|
|
|
2017-02-11 21:46:41 +00:00
|
|
|
CMD /usr/bin/supervisord --configuration supervisord.conf
|