docker-android/Dockerfile

110 lines
3.2 KiB
Docker
Raw Normal View History

2017-01-16 11:58:54 +00:00
FROM ubuntu:16.04
2016-12-22 13:29:57 +00:00
#=======================
# General Configuration
#=======================
2017-01-08 16:24:14 +00:00
ENV DEBIAN_FRONTEND noninteractive
2017-01-16 11:58:54 +00:00
RUN apt-get update -y
2017-01-08 16:24:14 +00:00
#=====================================
# Install virtual display framebuffer
#=====================================
2017-01-16 11:58:54 +00:00
RUN apt-get install xvfb x11vnc -y
2017-01-08 16:24:14 +00:00
2017-01-16 11:58:54 +00:00
#=========================================================
# Install Windows Manager, Debian Menu, Numpy and Netstat
2017-01-08 16:24:14 +00:00
# https://github.com/novnc/websockify/issues/77
2017-01-16 11:58:54 +00:00
#=========================================================
RUN apt-get install openbox menu python-numpy net-tools -y
2017-01-08 16:24:14 +00:00
2017-02-11 21:46:41 +00:00
#====================
# Install Supervisor
#====================
RUN apt-get install supervisor -y
#=============
# Set WORKDIR
#=============
WORKDIR /root
2017-01-08 16:24:14 +00:00
#======================
# Clone noVNC projects
#======================
RUN apt-get install git -y
RUN git clone https://github.com/kanaka/noVNC.git && \
cd noVNC/utils && git clone https://github.com/kanaka/websockify websockify
2016-12-22 13:29:57 +00:00
#==============
# Install Java
#==============
2017-01-16 11:58:54 +00:00
RUN apt-get install openjdk-8-jdk -y
ENV JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64/jre"
2016-12-22 13:29:57 +00:00
ENV PATH="${PATH}:${JAVA_HOME}/bin"
#=====================
# Install Android SDK
#=====================
2017-02-24 10:56:48 +00:00
RUN apt-get install wget unzip libqt5webkit5 -y
2017-02-24 09:55:31 +00:00
RUN wget https://dl.google.com/android/repository/tools_r25.2.3-linux.zip
RUN unzip tools_r25.2.3-linux.zip && rm tools_r25.2.3-linux.zip
ENV ANDROID_HOME="/root"
2016-12-22 13:29:57 +00:00
ENV PATH="${PATH}:${ANDROID_HOME}/tools"
#=====================================================
# Install Platform-tools, Build-tools
# To see list of available packages: android list sdk
#=====================================================
RUN echo y | android update sdk --no-ui --filter 2,3
ENV PATH="${PATH}:${ANDROID_HOME}/platform-tools"
ENV PATH="${PATH}:${ANDROID_HOME}/build-tools"
2017-01-08 16:24:14 +00:00
RUN mv ${ANDROID_HOME}/tools/emulator ${ANDROID_HOME}/tools/emulator.backup
2016-12-22 13:29:57 +00:00
2017-01-08 16:24:14 +00:00
#====================================
# Install latest nodejs, npm, appium
#====================================
RUN apt-get install curl -y
2017-01-16 11:58:54 +00:00
RUN curl -sL https://deb.nodesource.com/setup_7.x | bash -
2017-01-08 16:24:14 +00:00
RUN apt-get install nodejs -y
2016-12-22 13:29:57 +00:00
ENV APPIUM_VERSION 1.6.3
RUN npm install -g appium@$APPIUM_VERSION
2017-01-23 16:25:21 +00:00
#============================================================
# Install KVM for emulator x86
# Source: https://help.ubuntu.com/community/KVM/Installation
#============================================================
RUN apt-get install qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils -y
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 \
LOG_PATH=/var/log/supervisor
2017-01-08 16:24:14 +00:00
RUN ln -s noVNC/vnc_auto.html noVNC/index.html
2017-01-23 16:25:21 +00:00
#==============
# Expose Ports
#==============
EXPOSE 4723
EXPOSE 6080
2017-02-11 21:46:41 +00:00
#==================
# Add Browser APKs
#==================
COPY example/browser_apk /root/browser_apk
2016-12-22 13:29:57 +00:00
#===================
# Run docker-appium
#===================
2017-02-11 21:46:41 +00:00
COPY supervisord.conf /root/
2017-01-08 16:24:14 +00:00
COPY service /root/service
2017-02-11 21:46:41 +00:00
CMD /usr/bin/supervisord --configuration supervisord.conf