Last active
February 23, 2019 11:21
-
-
Save eliasnaur/e9bee4b763428425d2e9739618e38623 to your computer and use it in GitHub Desktop.
Dockerfile with Android emulator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright 2014 The Go Authors. All rights reserved. | |
# Use of this source code is governed by a BSD-style | |
# license that can be found in the LICENSE file. | |
FROM debian:sid | |
MAINTAINER golang-dev <[email protected]> | |
ENV DEBIAN_FRONTEND noninteractive | |
# gdb: optionally used by runtime tests for gdb | |
# strace: optionally used by some net/http tests | |
# gcc libc6-dev: for building Go's bootstrap 'dist' prog | |
# libc6-dev-i386 gcc-multilib: for 32-bit builds | |
# procps lsof psmisc: misc basic tools | |
# libgles2-mesa-dev libopenal-dev fonts-noto: required by x/mobile repo | |
# unzip openjdk-8-jdk python lib32z1: required by the Android SDK | |
RUN apt-get update && apt-get install -y \ | |
--no-install-recommends \ | |
ca-certificates \ | |
curl \ | |
gdb \ | |
strace \ | |
gcc \ | |
libc6-dev \ | |
libc6-dev-i386 \ | |
gcc-multilib \ | |
procps \ | |
lsof \ | |
psmisc \ | |
libgles2-mesa-dev \ | |
libopenal-dev \ | |
fonts-noto \ | |
fonts-noto-mono \ | |
openssh-server \ | |
unzip \ | |
openjdk-8-jdk \ | |
python \ | |
lib32z1 \ | |
&& rm -rf /var/lib/apt/lists/* | |
RUN mkdir -p /go1.4-amd64 \ | |
&& ( \ | |
curl --silent https://storage.googleapis.com/golang/go1.4.linux-amd64.tar.gz | tar -C /go1.4-amd64 -zxv \ | |
) \ | |
&& mv /go1.4-amd64/go /go1.4 \ | |
&& rm -rf /go1.4-amd64 \ | |
&& rm -rf /go1.4/pkg/linux_amd64_race \ | |
/go1.4/api \ | |
/go1.4/blog \ | |
/go1.4/doc \ | |
/go1.4/misc \ | |
/go1.4/test \ | |
&& find /go1.4 -type d -name testdata | xargs rm -rf | |
RUN curl -o /usr/local/bin/stage0 https://storage.googleapis.com/go-builder-data/buildlet-stage0.linux-amd64-kube \ | |
&& chmod +x /usr/local/bin/stage0 | |
RUN mkdir -p /android/sdk \ | |
&& curl -o /android/sdk/sdk-tools-linux.zip https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip \ | |
&& unzip -d /android/sdk /android/sdk/sdk-tools-linux.zip \ | |
&& rm -rf /android/sdk/sdk-tools-linux.zip | |
RUN yes | /android/sdk/tools/bin/sdkmanager --licenses \ | |
&& /android/sdk/tools/bin/sdkmanager ndk-bundle "system-images;android-26;default;x86_64" \ | |
&& /android/sdk/tools/bin/sdkmanager "build-tools;21.1.2" "platforms;android-26" \ | |
&& /android/sdk/tools/bin/sdkmanager --update | |
# Gradle for gomobile | |
RUN curl -L -o /android/gradle-5.2.1-bin.zip https://services.gradle.org/distributions/gradle-5.2.1-bin.zip \ | |
&& unzip -d /android /android/gradle-5.2.1-bin.zip \ | |
&& rm /android/gradle-5.2.1-bin.zip | |
# Cleanup | |
RUN rm -rf /android/sdk/sdk-tools-linux.zip \ | |
&& apt-get -y remove unzip \ | |
&& apt-get -y autoremove | |
COPY run-emulator.sh /android/run-emulator.sh | |
RUN chmod +x /android/run-emulator.sh | |
# Include a checkout of Go | |
COPY go-tip /go-tip | |
# Create emulator instance | |
RUN echo no | /android/sdk/tools/bin/avdmanager create avd --force --name android-avd --package "system-images;android-26;default;x86_64" | |
CMD ["/usr/local/bin/stage0"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment