FROM ubuntu:16.04 LABEL maintainer "Lukasz Fryc " WORKDIR /root #================== # General Packages #------------------ # openjdk-8-jdk # Java # ca-certificates # SSL client # tzdata # Timezone # zip # Make a zip file # unzip # Unzip zip file # curl # Transfer data from or to a server # wget # Network downloader # libqt5webkit5 # Web content engine (Fix issue in Android) # libgconf-2-4 # Required package for chrome and chromedriver to run on Linux # xvfb # X virtual framebuffer #================== RUN apt-get -qqy update && \ apt-get -qqy --no-install-recommends install \ openjdk-8-jdk \ ca-certificates \ tzdata \ zip \ unzip \ curl \ wget \ libqt5webkit5 \ libgconf-2-4 \ xvfb \ build-essential \ && rm -rf /var/lib/apt/lists/* #=============== # Set JAVA_HOME #=============== ENV JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64/jre" \ PATH=$PATH:$JAVA_HOME/bin #===================== # Install Android SDK #===================== ARG SDK_VERSION=sdk-tools-linux-4333796 ARG ANDROID_BUILD_TOOLS_VERSION=28.0.1 ARG ANDROID_PLATFORM_VERSION="android-27" ENV SDK_VERSION=$SDK_VERSION \ ANDROID_BUILD_TOOLS_VERSION=$ANDROID_BUILD_TOOLS_VERSION \ ANDROID_HOME=/root RUN wget -O tools.zip https://dl.google.com/android/repository/${SDK_VERSION}.zip && \ unzip tools.zip && rm tools.zip && \ chmod a+x -R $ANDROID_HOME && \ chown -R root:root $ANDROID_HOME ENV PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin # https://askubuntu.com/questions/885658/android-sdk-repositories-cfg-could-not-be-loaded RUN mkdir -p ~/.android && \ touch ~/.android/repositories.cfg && \ echo y | sdkmanager "platform-tools" && \ echo y | sdkmanager "build-tools;$ANDROID_BUILD_TOOLS_VERSION" && \ echo y | sdkmanager "platforms;$ANDROID_PLATFORM_VERSION" ENV PATH=$PATH:$ANDROID_HOME/platform-tools:$ANDROID_HOME/build-tools #==================================== # Install latest nodejs, npm, appiuma #==================================== # ARG APPIUM_VERSION=1.7.2 # ENV APPIUM_VERSION=$APPIUM_VERSION RUN curl -sL https://deb.nodesource.com/setup_9.x | bash - RUN apt-get -qqy install nodejs RUN npm set maxsockets 3 && \ npm install -g appium@1.7.2 --unsafe-perm=true --allow-root RUN apt-get remove --purge -y npm && \ apt-get autoremove --purge -y && \ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \ apt-get clean #================================== # Fix Issue with timezone mismatch #================================== # ENV TZ="US/Pacific" # RUN echo "${TZ}" > /etc/timezone #=============== # Expose Ports #--------------- # 4723 # Appium port #=============== EXPOSE 4723 COPY entry_point.sh /root/ RUN chmod +x /root/entry_point.sh ENTRYPOINT /root/entry_point.sh