Skip to content

Commit a544687

Browse files
red-avtovoSrinivasanTarget
authored andcommitted
reduced docker image layers (#56)
added Android Platform to docker image
1 parent 903c562 commit a544687

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ before_install:
99
- docker -v
1010

1111
script:
12-
- docker build -t "appium/appium:latest" --build-arg SDK_VERSION=$SDK_VERSION --build-arg ANDROID_BUILD_TOOLS_VERSION=$ANDROID_BUILD_TOOLS_VERSION --build-arg APPIUM_VERSION=$APPIUM_VERSION -f Appium/Dockerfile .
12+
- docker build -t "appium/appium:latest" --build-arg SDK_VERSION=$SDK_VERSION --build-arg ANDROID_BUILD_TOOLS_VERSION=$ANDROID_BUILD_TOOLS_VERSION --build-arg APPIUM_VERSION=$APPIUM_VERSION -f Appium/Dockerfile .
1313
- docker run --rm -v $PWD/Appium/tests:/root/tests "appium/appium:latest" bash tests/run-bats.sh
1414
- docker images
1515

Appium/Dockerfile

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ WORKDIR /root
1818
# SSL client
1919
# tzdata
2020
# Timezone
21+
# zip
22+
# Make a zip file
2123
# unzip
2224
# Unzip zip file
2325
# curl
@@ -36,6 +38,7 @@ RUN apt-get -qqy update && \
3638
openjdk-8-jdk \
3739
ca-certificates \
3840
tzdata \
41+
zip \
3942
unzip \
4043
curl \
4144
wget \
@@ -55,6 +58,8 @@ ENV JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64/jre" \
5558
#=====================
5659
ARG SDK_VERSION=sdk-tools-linux-3859397
5760
ARG ANDROID_BUILD_TOOLS_VERSION=26.0.0
61+
ARG ANDROID_PLATFORM_VERSION="android-25"
62+
5863
ENV SDK_VERSION=$SDK_VERSION \
5964
ANDROID_BUILD_TOOLS_VERSION=$ANDROID_BUILD_TOOLS_VERSION \
6065
ANDROID_HOME=/root
@@ -63,14 +68,16 @@ RUN wget -O tools.zip https://dl.google.com/android/repository/${SDK_VERSION}.zi
6368
unzip tools.zip && rm tools.zip && \
6469
chmod a+x -R $ANDROID_HOME && \
6570
chown -R root:root $ANDROID_HOME
71+
6672
ENV PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin
6773

6874
# https://askubuntu.com/questions/885658/android-sdk-repositories-cfg-could-not-be-loaded
69-
RUN mkdir -p ~/.android
70-
RUN touch ~/.android/repositories.cfg
75+
RUN mkdir -p ~/.android && \
76+
touch ~/.android/repositories.cfg && \
77+
echo y | sdkmanager "platform-tools" && \
78+
echo y | sdkmanager "build-tools;$ANDROID_BUILD_TOOLS_VERSION" && \
79+
echo y | sdkmanager "platforms;$ANDROID_PLATFORM_VERSION"
7180

72-
RUN echo y | sdkmanager "platform-tools"
73-
RUN echo y | sdkmanager "build-tools;$ANDROID_BUILD_TOOLS_VERSION"
7481
ENV PATH=$PATH:$ANDROID_HOME/platform-tools:$ANDROID_HOME/build-tools
7582

7683
#====================================
@@ -109,8 +116,8 @@ COPY \
109116
Appium/entry_point.sh \
110117
Appium/generate_config.sh \
111118
/root/
112-
RUN chmod +x /root/entry_point.sh
113-
RUN chmod +x /root/generate_config.sh
119+
RUN chmod +x /root/entry_point.sh && \
120+
chmod +x /root/generate_config.sh
114121

115122
#========================================
116123
# Run xvfb and appium server

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ For example:
100100
$ docker run --privileged -d -p 4723:4723 -v ~/.android:/root/.android -v /dev/bus/usb:/dev/bus/usb --name container-appium appium/appium
101101
```
102102
103-
### Connect to Android devices by Air
103+
## Connect to Android devices by Air
104104
105105
Appium-Docker-Android can be connected with Android devices by Air.
106106

0 commit comments

Comments
 (0)