appium / appium-docker-android

Appium Server setup to automate android testing on real devices
https://hub.docker.com/r/appium/
Other
605 stars 230 forks source link

unable to start container #107

Closed amrsa1 closed 5 years ago

amrsa1 commented 5 years ago

i am trying to build the image using the docker file included on the repo ,but after executing the following command i dont see any running container however if i pulled the image directly (appium/appium) it works fine, i guess the problem with the docker file i didnt change anything except version of appium and platform tools

image

image

dockerfile

`FROM ubuntu:18.04

LABEL maintainer "Srinivasan Sekar srinivasan.sekar1990@gmail.com"

ENV DEBIAN_FRONTEND=noninteractive

=============

Set WORKDIR

=============

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

gnupg

Encryption software. It is needed for nodejs

salt-minion

Infrastructure management (client-side)

==================

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 \ gnupg \ salt-minion \ && 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=29.0.0 ARG ANDROID_PLATFORM_VERSION="android-29"

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, appium

Using this workaround to install Appium -> https://github.com/appium/appium/issues/10020 -> Please remove this workaround asap

====================================

ARG APPIUM_VERSION=1.13.0 ENV APPIUM_VERSION=$APPIUM_VERSION

RUN curl -sL https://deb.nodesource.com/setup_10.x | bash && \ apt-get -qqy install nodejs && \ npm install -g appium@${APPIUM_VERSION} --unsafe-perm=true --allow-root && \ exit 0 && \ npm cache clean && \ 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 -> 4730

Appium port

===============

EXPOSE 4723 EXPOSE 4725 EXPOSE 4726 EXPOSE 4727 EXPOSE 4728 EXPOSE 4729 EXPOSE 4730

====================================================

Scripts to run appium and connect to Selenium Grid

====================================================

COPY entry_point.sh \

generate_config.sh \

wireless_connect.sh \

wireless_autoconnect.sh \

# /root/

COPY entry_point.sh /root/entry_point.sh COPY generate_config.sh /root/generate_config.sh COPY wireless_connect.sh /root/wireless_connect.sh COPY wireless_autoconnect.sh /root/wireless_autoconnect.sh

RUN chmod +x /root/entry_point.sh && \ chmod +x /root/generate_config.sh && \ chmod +x /root/wireless_connect.sh && \ chmod +x /root/wireless_autoconnect.sh

========================================

Run xvfb and appium server

========================================

CMD /root/wireless_autoconnect.sh && /root/entry_point.sh `

budtmo commented 5 years ago

Hi @Amrkamel1 ,

In my opinion, it is better if you use the docker-image that we provided as base image if you want to customize / extend the functions, e.g. adding some custom feature to avoid conflicts. in case you want to build it, please follow this command.

I will close this issue, because it is not a bug

EuphoriaCelestial commented 2 years ago

Hi @budtmo , could you please re-upload the guide to build? the link above doesn't work anymore, I am having the same issue, I didn't change anything in Dockerfile btw, I am trying to change base image of appium from ubuntu:bionic-20220801 to nvidia/cuda:11.3.0-base-ubuntu18.04 to make use of gpu devices, can you give some advice on how to do that?