Skip to content
This repository has been archived by the owner on Jul 5, 2023. It is now read-only.

Commit

Permalink
add Dockerfile for Android 26 sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
Maychell committed Oct 6, 2017
1 parent eafc349 commit 8e80fe4
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 2 deletions.
43 changes: 43 additions & 0 deletions 26/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
FROM openjdk:8-jdk
MAINTAINER Maychell Oliveira <[email protected]>

# Android SDK
ENV ANDROID_HOME /srv/var/android-sdk

# Install required tools
RUN apt-get --quiet update --yes \
&& apt-get --quiet install --yes wget tar unzip lib32stdc++6 lib32z1 --no-install-recommends

# Install Android SDK tools into ${ANDROID_HOME}
RUN mkdir -p ${ANDROID_HOME}
RUN wget --quiet --output-document=android-sdk.zip https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip \
&& unzip android-sdk.zip -d ${ANDROID_HOME} \
&& rm -f android-sdk.zip

ENV PATH ${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/tools/bin:${ANDROID_HOME}/platform-tools

# Accept "android-sdk-license" before installing components, no need to echo y for each component
# License is valid for all the standard components in versions installed from this file
# Non-standard components: MIPS system images, preview versions, GDK (Google Glass) and Android Google TV require separate licenses, not accepted there
RUN mkdir -p ${ANDROID_HOME}/licenses \
&& echo 8933bad161af4178b1185d1a37fbf41ea5269c55 > ${ANDROID_HOME}/licenses/android-sdk-license

# Install platform tools
RUN ln -s ${ANDROID_HOME}/bin/sdkmanager /usr/bin/sdkmanager \
&& sdkmanager "platform-tools"

# Emulator
ENV EMULATOR_HOME /srv/var/emulator
# Download emulator
RUN wget https://dl.google.com/android/repository/emulator-linux-4077558.zip -O emulator.zip \
&& unzip -q emulator.zip -d $EMULATOR_HOME \
&& rm -f emulator.zip

# SDKs
# Please keep these in descending order!
RUN echo y | sdkmanager \
"platforms;android-26" \
"build-tools;26.0.2"

RUN ln -s ${EMULATOR_HOME}/emulator64-x86 /usr/bin/emulator64-x86 && \
emulator64-x86 -avd test -no-window -no-audio &
33 changes: 31 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,31 @@
# docker-ci-android
Docker Android images used by Gitlab CI
# Codeminer42 Android Image for CI builds

Docker Android images used by Gitlab CI.

## Dependencies

The following dependencies are being installed on all images:

* Android 26 sdk for linux
* Android Emulator

## Tags

We currently have images for the following Android versions.

### Android images

- `26`, `latest` [Dockerfile](https://github.com/Codeminer42/docker-ci-android/blob/master/26/Dockerfile)

## Contributing

`Dockerfiles` are stored under folders for each version.

For updating the images, just open a _pull request_ with
the new `Dockerfile` version and, after accepted, Docker
Hub will build automatically after a few minutes.

The images should setup an environment that is widely used,
please don't install dependencies that are specific to a
project. It's also good to have a pattern and all images
support the same things.

0 comments on commit 8e80fe4

Please sign in to comment.