Reduced docker image size to 2.259 GB

This commit is contained in:
butomo1989 2017-03-21 18:08:24 +01:00
parent f4e16a3cf2
commit bbab571a05

View file

@ -1,78 +1,103 @@
FROM ubuntu:16.04 FROM ubuntu:16.04
#=======================
# General Configuration
#=======================
ENV DEBIAN_FRONTEND noninteractive ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update -y
#=====================================
# Install virtual display framebuffer
#=====================================
RUN apt-get install xvfb x11vnc -y
#=========================================================
# Install Windows Manager, Debian Menu, Numpy and Netstat
# https://github.com/novnc/websockify/issues/77
#=========================================================
RUN apt-get install openbox menu python-numpy net-tools -y
#====================
# Install Supervisor
#====================
RUN apt-get install supervisor -y
#============= #=============
# Set WORKDIR # Set WORKDIR
#============= #=============
WORKDIR /root WORKDIR /root
#==================
# General Packages
#------------------
# git
# Clone git repository
# wget
# Network downloader
# unzip
# Unzip zip file
# curl
# Transfer data from or to a server
# supervisor
# Process manager
# openjdk-8-jdk
# Java
# libqt5webkit5
# Web content engine (Fix issue in Android)
#------------------
# NoVNC Packages
#------------------
# xvfb
# X virtual framebuffer
# 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
#------------------
# KVM Package
# for emulator x86
# https://help.ubuntu.com/community/KVM/Installation
#------------------
# qemu-kvm
# libvirt-bin
# ubuntu-vm-builder
# bridge-utils
#==================
RUN apt-get update && apt-get install -y \
git \
wget \
unzip \
curl \
supervisor \
openjdk-8-jdk \
libqt5webkit5 \
xvfb \
x11vnc \
openbox \
menu \
python-numpy \
net-tools \
qemu-kvm \
libvirt-bin \
ubuntu-vm-builder \
bridge-utils \
&& rm -rf /var/lib/apt/lists/*
#====================== #======================
# Clone noVNC projects # Clone noVNC projects
#====================== #======================
RUN apt-get install git -y RUN git clone https://github.com/kanaka/noVNC.git \
RUN git clone https://github.com/kanaka/noVNC.git && \ && cd noVNC/utils && git clone https://github.com/kanaka/websockify websockify
cd noVNC/utils && git clone https://github.com/kanaka/websockify websockify
#============== #======================================
# Install Java # Install Android SDK and its packages
#============== #======================================
RUN apt-get install openjdk-8-jdk -y ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64/jre
ENV JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64/jre" ENV PATH ${PATH}:${JAVA_HOME}/bin
ENV PATH="${PATH}:${JAVA_HOME}/bin"
#===================== ENV SDK_VERSION=25.2.3 \
# Install Android SDK BUILD_TOOL=25.0.2 \
#===================== ANDROID_HOME=/root
RUN apt-get install wget unzip libqt5webkit5 -y RUN wget -O android.zip https://dl.google.com/android/repository/tools_r${SDK_VERSION}-linux.zip \
&& unzip android.zip && rm android.zip
RUN wget https://dl.google.com/android/repository/tools_r25.2.3-linux.zip && \ ENV PATH ${PATH}:${ANDROID_HOME}/tools
unzip tools_r25.2.3-linux.zip && rm tools_r25.2.3-linux.zip RUN echo y | android update sdk --no-ui --filter platform-tools,build-tools-${BUILD_TOOL}
ENV ANDROID_HOME="/root" ENV PATH ${PATH}:${ANDROID_HOME}/platform-tools:${ANDROID_HOME}/build-tools
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 platform-tools,build-tools-25.0.2
ENV PATH="${PATH}:${ANDROID_HOME}/platform-tools:${ANDROID_HOME}/build-tools"
RUN mv ${ANDROID_HOME}/tools/emulator ${ANDROID_HOME}/tools/emulator.backup RUN mv ${ANDROID_HOME}/tools/emulator ${ANDROID_HOME}/tools/emulator.backup
#==================================== #====================================
# Install latest nodejs, npm, appium # Install latest nodejs, npm, appium
#==================================== #====================================
RUN apt-get install curl -y RUN curl -sL https://deb.nodesource.com/setup_7.x | bash - \
RUN curl -sL https://deb.nodesource.com/setup_7.x | bash - && apt-get update && apt-get install -y nodejs && rm -rf /var/lib/apt/lists/*
RUN apt-get install nodejs -y
ENV APPIUM_VERSION 1.6.3 ENV APPIUM_VERSION 1.6.3
RUN npm install -g appium@$APPIUM_VERSION RUN npm install -g appium@$APPIUM_VERSION && npm cache clean
#============================================================
# 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
#================================================ #================================================
# noVNC Default Configurations # noVNC Default Configurations
@ -89,11 +114,15 @@ ENV DISPLAY=:0 \
LOG_PATH=/var/log/supervisor LOG_PATH=/var/log/supervisor
RUN ln -s noVNC/vnc_auto.html noVNC/index.html RUN ln -s noVNC/vnc_auto.html noVNC/index.html
#============== #===============
# Expose Ports # Expose Ports
#============== #---------------
EXPOSE 4723 # 4723
EXPOSE 6080 # appium port
# 6080
# noVNC port
#===============
EXPOSE 4723 6080
#================== #==================
# Add Browser APKs # Add Browser APKs