Skip to content

Commit 1a28d03

Browse files
author
Bastien DAVID
committed
Added base docker files + API 16
Base image for emulator, and emulator with API 16.
1 parent c7188d6 commit 1a28d03

File tree

3 files changed

+43
-0
lines changed

3 files changed

+43
-0
lines changed

android-16/Dockerfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM softsam/android
2+
3+
MAINTAINER softsam
4+
5+
# Install dependencies for emulator
6+
RUN echo y | android update sdk --no-ui --all -t `android list sdk --all|grep "SDK Platform Android 4.1.2, API 16"|awk -F'[^0-9]*' '{print $2}'` && \
7+
echo y | android update sdk --no-ui --all -t `android list sdk --all|grep "ARM EABI v7a System Image, Android API 16"|awk -F'[^0-9]*' '{print $2}'`
8+
9+
# Expose android port
10+
EXPOSE 5555
11+
12+
RUN echo n | android create avd --force -n "ANDROID" -t android-16
13+
14+
# Add script
15+
ADD start.sh /start.sh
16+
RUN chmod +x /start.sh
17+
CMD /start.sh

android-16/start.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
# Detect ip and forward ADB ports outside to outside interface
4+
ip=$(ip addr list eth0|grep "inet "|cut -d' ' -f6|cut -d/ -f1)
5+
#socat tcp-listen:5555,bind=$ip,fork tcp:127.0.0.1:5555 &
6+
redir --laddr=$ip --lport=5555 --caddr=127.0.0.1 --cport=5555 &
7+
8+
# Set up and run emulator
9+
emulator -avd ANDROID -noaudio -no-window -gpu off -verbose -force-32bit

android-base/Dockerfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM debian:latest
2+
3+
MAINTAINER softsam
4+
5+
# Install all dependencies
6+
RUN apt-get update && \
7+
apt-get install -y wget openjdk-7-jre-headless libc6-i386 lib32stdc++6 redir && \
8+
apt-get clean && \
9+
apt-get autoclean && \
10+
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
11+
12+
# Install android tools + sdk
13+
ENV ANDROID_HOME /opt/android-sdk-linux
14+
ENV PATH $PATH:${ANDROID_HOME}/tools:$ANDROID_HOME/platform-tools
15+
16+
RUN wget -qO- "http://dl.google.com/android/android-sdk_r24.3.3-linux.tgz" | tar -zx -C /opt && \
17+
echo y | android update sdk --no-ui --all --filter platform-tools --force

0 commit comments

Comments
 (0)