Skip to content

Commit

Permalink
Use the SDK tools to install ADB, since it's no longer available in a…
Browse files Browse the repository at this point in the history
… bundle. Image size goes up but we gain access to the rest of the platform-tools/ and tools/.
  • Loading branch information
sorccu committed Jan 22, 2015
1 parent fd96962 commit 537a9ea
Showing 1 changed file with 14 additions and 20 deletions.
34 changes: 14 additions & 20 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,37 +1,31 @@
FROM ubuntu:14.04
MAINTAINER Simo Kinnunen

# Stop debconf from complaining about missing frontend
ENV DEBIAN_FRONTEND noninteractive

# 32-bit libraries and build deps for ADB
RUN dpkg --add-architecture i386 && \
apt-get update && \
apt-get -y install libc6:i386 libstdc++6:i386 && \
apt-get -y install wget unzip

# Install ADB
RUN wget --progress=dot:giga -O /opt/adt.zip \
http://dl.google.com/android/adt/adt-bundle-linux-x86_64-20140702.zip && \
unzip /opt/adt.zip adt-bundle-linux-x86_64-20140702/sdk/platform-tools/adb -d /opt && \
mv /opt/adt-bundle-linux-x86_64-20140702 /opt/adt && \
rm /opt/adt.zip && \
ln -s /opt/adt/sdk/platform-tools/adb /usr/local/bin/adb

# Set up insecure default key
RUN mkdir -m 0750 /.android
ADD files/insecure_shared_adbkey /.android/adbkey
ADD files/insecure_shared_adbkey.pub /.android/adbkey.pub

# Clean up
RUN apt-get -y --purge remove wget unzip && \
apt-get -y autoremove && \
# Note: ADB needs 32-bit libs
RUN export DEBIAN_FRONTEND=noninteractive && \
dpkg --add-architecture i386 && \
apt-get update && \
apt-get -y install libc6:i386 libstdc++6:i386 && \
apt-get -y install wget unzip openjdk-7-jre-headless && \
wget --progress=dot:giga -O /opt/adt.tgz \
https://dl.google.com/android/android-sdk_r24.0.2-linux.tgz && \
tar xzf /opt/adt.tgz -C /opt && \
rm /opt/adt.tgz && \
echo y | /opt/android-sdk-linux/tools/android update sdk --filter platform-tools --no-ui --force && \
apt-get clean && \
rm -rf /var/cache/apt/*

# Expose default ADB port
EXPOSE 5037

# Set up PATH
ENV PATH $PATH:/opt/android-sdk-linux/platform-tools:/opt/android-sdk-linux/tools

# Start the server by default. This needs to run in a shell or Ctrl+C won't
# work.
CMD /usr/local/bin/adb -a -P 5037 fork-server server

0 comments on commit 537a9ea

Please sign in to comment.