docker-android/docker/Emulator_x86

168 lines
4.7 KiB
Plaintext
Raw Normal View History

FROM appium/appium:1.8.1-p2
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
#======================
# Install SDK packages
#======================
2018-07-05 13:29:54 +01:00
ARG ANDROID_VERSION=5.0.1
ARG API_LEVEL=21
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
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
ENV ANDROID_VERSION=$ANDROID_VERSION \
API_LEVEL=$API_LEVEL \
PROCESSOR=$PROCESSOR \
2017-04-26 14:16:26 +01:00
SYS_IMG=$SYS_IMG \
IMG_TYPE=$IMG_TYPE \
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 \
GOOGLE_PLAY_STORE=$GOOGLE_PLAY_STORE
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-06-14 14:00:54 +01:00
#==============================================
# Download proper version of chromedriver
# to be able to use Chrome browser in emulator
2017-06-14 14:00:54 +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 \
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
2016-12-22 13:29:57 +00:00
#===================
# Run docker-appium
#===================
COPY src /root/src
COPY supervisord.conf /root/
2017-04-12 13:25:12 +01:00
RUN chmod -R +x /root/src && chmod +x /root/supervisord.conf
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-02-11 21:46:41 +00:00
CMD /usr/bin/supervisord --configuration supervisord.conf