2020-04-09 07:52:11 +01:00
|
|
|
FROM appium/appium:1.16.0-p1
|
2017-07-03 20:50:37 +01:00
|
|
|
|
2019-02-21 17:01:38 +00:00
|
|
|
LABEL maintainer "Budi Utomo <budtmo.os@gmail.com>"
|
2017-07-03 20:50:37 +01:00
|
|
|
|
|
|
|
#=============
|
|
|
|
# Set WORKDIR
|
|
|
|
#=============
|
|
|
|
WORKDIR /root
|
|
|
|
|
2019-07-09 13:13:52 +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-07-03 20:50:37 +01:00
|
|
|
#==================
|
|
|
|
# General Packages
|
|
|
|
#------------------
|
|
|
|
# xterm
|
|
|
|
# Terminal emulator
|
|
|
|
# supervisor
|
|
|
|
# Process manager
|
|
|
|
# socat
|
|
|
|
# Port forwarder
|
|
|
|
#------------------
|
|
|
|
# NoVNC Packages
|
|
|
|
#------------------
|
|
|
|
# x11vnc
|
|
|
|
# VNC server for X display
|
2019-07-09 13:13:52 +01:00
|
|
|
# We use package from ubuntu 18.10 to fix crashing issue
|
2017-07-03 20:50:37 +01:00
|
|
|
# openbox
|
|
|
|
# Windows manager
|
2019-07-10 15:07:20 +01:00
|
|
|
# feh
|
|
|
|
# ScreenBackground
|
|
|
|
# python-xdg
|
|
|
|
# Required by openbox autostart function
|
2017-07-03 20:50:37 +01:00
|
|
|
# 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-03 20:50:37 +01:00
|
|
|
#==================
|
2019-07-10 15:07:20 +01:00
|
|
|
ADD docker/configs/sources1810.list /etc/apt/sources.list.d/
|
|
|
|
ADD docker/configs/x11vnc.pref /etc/apt/preferences.d/
|
2017-07-03 20:50:37 +01:00
|
|
|
RUN apt-get -qqy update && apt-get -qqy install --no-install-recommends \
|
2018-05-12 12:13:21 +01:00
|
|
|
xterm \
|
2017-07-03 20:50:37 +01:00
|
|
|
supervisor \
|
|
|
|
socat \
|
|
|
|
x11vnc \
|
|
|
|
openbox \
|
2019-07-10 15:07:20 +01:00
|
|
|
feh \
|
|
|
|
python-xdg \
|
2017-07-03 20:50:37 +01:00
|
|
|
menu \
|
|
|
|
python-numpy \
|
|
|
|
net-tools \
|
2017-07-14 19:40:14 +01:00
|
|
|
ffmpeg \
|
2017-10-27 20:00:10 +01:00
|
|
|
jq \
|
2019-09-06 13:11:06 +01:00
|
|
|
curl \
|
|
|
|
libavcodec-dev \
|
|
|
|
libavformat-dev \
|
|
|
|
libavutil-dev \
|
|
|
|
gcc \
|
|
|
|
git \
|
|
|
|
make \
|
|
|
|
meson \
|
|
|
|
musl-dev \
|
|
|
|
pkgconf \
|
|
|
|
libsdl2-dev \
|
2019-07-09 13:13:52 +01:00
|
|
|
&& apt clean all \
|
2017-07-03 20:50:37 +01:00
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
2019-09-06 13:11:06 +01:00
|
|
|
|
|
|
|
#===========
|
|
|
|
# scrcpy - screen copy
|
|
|
|
# https://github.com/Genymobile/scrcpy
|
|
|
|
#===========
|
|
|
|
ARG SCRCPY_VER=1.10
|
|
|
|
ARG SERVER_HASH="cbeb1a4e046f1392c1dc73c3ccffd7f86dec4636b505556ea20929687a119390"
|
|
|
|
|
|
|
|
RUN mkdir /root/scrcpy
|
|
|
|
RUN curl -L -o /root/scrcpy/scrcpy-code.zip https://github.com/Genymobile/scrcpy/archive/v${SCRCPY_VER}.zip
|
|
|
|
RUN curl -L -o /root/scrcpy/scrcpy-server.jar https://github.com/Genymobile/scrcpy/releases/download/v${SCRCPY_VER}/scrcpy-server-v${SCRCPY_VER}.jar
|
|
|
|
RUN echo "$SERVER_HASH scrcpy/scrcpy-server.jar" | sha256sum -c -
|
|
|
|
RUN cd scrcpy && unzip -x scrcpy-code.zip
|
|
|
|
RUN cd scrcpy/scrcpy-${SCRCPY_VER} && meson x --buildtype release --strip -Db_lto=true -Dprebuilt_server=/root/scrcpy/scrcpy-server.jar
|
|
|
|
RUN cd scrcpy/scrcpy-${SCRCPY_VER}/x && ninja && ninja install
|
|
|
|
RUN rm -rf scrcpy/
|
|
|
|
|
|
|
|
|
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-07-03 20:50:37 +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"
|
|
|
|
RUN wget -nv -O noVNC.zip "https://github.com/kanaka/noVNC/archive/${NOVNC_SHA}.zip" \
|
|
|
|
&& unzip -x noVNC.zip \
|
|
|
|
&& rm noVNC.zip \
|
|
|
|
&& mv noVNC-${NOVNC_SHA} noVNC \
|
|
|
|
&& wget -nv -O websockify.zip "https://github.com/kanaka/websockify/archive/${WEBSOCKIFY_SHA}.zip" \
|
|
|
|
&& unzip -x websockify.zip \
|
|
|
|
&& mv websockify-${WEBSOCKIFY_SHA} ./noVNC/utils/websockify \
|
|
|
|
&& rm websockify.zip \
|
|
|
|
&& ln noVNC/vnc_auto.html noVNC/index.html
|
|
|
|
|
2018-02-12 09:49:26 +00:00
|
|
|
#================================================
|
2017-07-03 20:50:37 +01:00
|
|
|
# noVNC Default Configurations
|
|
|
|
# These Configurations can be changed through -e
|
|
|
|
#================================================
|
2018-10-26 14:00:46 +01:00
|
|
|
ARG APP_RELEASE_VERSION=1.5-p0
|
2017-07-03 20:50:37 +01:00
|
|
|
ENV DISPLAY=:0 \
|
|
|
|
SCREEN=0 \
|
|
|
|
SCREEN_WIDTH=1600 \
|
|
|
|
SCREEN_HEIGHT=900 \
|
|
|
|
SCREEN_DEPTH=16 \
|
|
|
|
LOCAL_PORT=5900 \
|
|
|
|
TARGET_PORT=6080 \
|
|
|
|
TIMEOUT=1 \
|
2017-07-14 19:40:14 +01:00
|
|
|
VIDEO_PATH=/tmp/video \
|
2018-10-26 14:00:46 +01:00
|
|
|
LOG_PATH=/var/log/supervisor \
|
|
|
|
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=Device
|
2017-07-03 20:50:37 +01:00
|
|
|
|
2019-07-09 13:13:52 +01:00
|
|
|
#================================================
|
|
|
|
# openbox configuration
|
|
|
|
# Update the openbox configuration files to:
|
|
|
|
# + Use a single virtual desktop to prevent accidentally switching
|
2019-07-10 15:07:20 +01:00
|
|
|
# + Add background
|
2019-07-09 13:13:52 +01:00
|
|
|
#================================================
|
2019-07-10 15:07:20 +01:00
|
|
|
ADD images/logo_dockerandroid_small.png /root/logo.png
|
2019-07-10 15:09:08 +01:00
|
|
|
ADD src/.fehbg /root/.fehbg
|
2019-07-10 15:07:20 +01:00
|
|
|
RUN sed -i "s/<number>4<\/number>/<number>1<\/number>/g" /etc/xdg/openbox/rc.xml \
|
2019-07-10 15:09:08 +01:00
|
|
|
&& echo /root/.fehbg >> /etc/xdg/openbox/autostart
|
2019-07-09 13:13:52 +01:00
|
|
|
|
2017-07-03 20:50:37 +01:00
|
|
|
#=========================
|
|
|
|
# Set default variables
|
|
|
|
#=========================
|
2018-05-28 20:02:26 +01:00
|
|
|
ENV APPIUM_LOG=$LOG_PATH/appium.log
|
|
|
|
ENV REAL_DEVICE=true
|
2017-07-03 20:50:37 +01:00
|
|
|
ENV BROWSER=android
|
|
|
|
|
|
|
|
#===============
|
|
|
|
# Expose Ports
|
|
|
|
#---------------
|
|
|
|
# 4723
|
|
|
|
# Appium port
|
|
|
|
# 6080
|
|
|
|
# noVNC port
|
|
|
|
# 5555
|
|
|
|
# ADB connection port
|
|
|
|
#===============
|
|
|
|
EXPOSE 4723 6080 5555
|
|
|
|
|
|
|
|
#===================
|
|
|
|
# Run docker-appium
|
|
|
|
#===================
|
|
|
|
COPY src /root/src
|
|
|
|
COPY supervisord.conf /root/
|
|
|
|
RUN chmod -R +x /root/src && chmod +x /root/supervisord.conf
|
|
|
|
|
|
|
|
CMD /usr/bin/supervisord --configuration supervisord.conf
|