-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.arm64
72 lines (59 loc) · 2.52 KB
/
Dockerfile.arm64
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Android development environment for ubuntu.
# version 0.0.5
FROM ubuntu:18.04
MAINTAINER xianghang <[email protected]>
# Specially for SSH access and port redirection
ENV ROOTPASSWORD rpaas
# Expose ADB, ADB control and VNC ports
EXPOSE 22
EXPOSE 5037
EXPOSE 5554
EXPOSE 5555
EXPOSE 5900
EXPOSE 80
EXPOSE 443
ENV DEBIAN_FRONTEND noninteractive
RUN echo "debconf shared/accepted-oracle-license-v1-1 select true" | debconf-set-selections && \
echo "debconf shared/accepted-oracle-license-v1-1 seen true" | debconf-set-selections
# Update packages
RUN apt-get -y update && \
apt-get -y install software-properties-common bzip2 ssh net-tools openssh-server socat curl && \
apt-get install -y --no-install-recommends openjdk-8-jdk && \
rm -rf /var/lib/apt/lists/*
# install kvm
RUN apt-get -y update && \
apt-get -y install qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils
# Install android sdk as part of the docker image
# TODO the ANDROID_SDK_VERSION is subject to updates
# download and install Android SDK
# https://developer.android.com/studio/#downloads
ARG ANDROID_SDK_VERSION=4333796
ENV ANDROID_HOME /usr/local/android-sdk
RUN mkdir -p ${ANDROID_HOME} && cd ${ANDROID_HOME} && \
wget -q https://dl.google.com/android/repository/sdk-tools-linux-${ANDROID_SDK_VERSION}.zip && \
unzip *tools*linux*.zip && \
rm *tools*linux*.zip
# Add android tools and platform tools to PATH
# set the environment variables
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-arm64
ENV PATH $PATH:$ANDROID_HOME/tools
ENV PATH $PATH:$ANDROID_HOME/tools
ENV PATH $PATH:$ANDROID_HOME/platform-tools
# Install latest android tools and system images
RUN ( sleep 4 && while [ 1 ]; do sleep 1; echo y; done ) | android update sdk --no-ui --force -a --filter \
2,4,android-25,android-28,sys-img-armeabi-v7a-google_apis-25,sys-img-armeabi-v7a-google_apis-28,sys-img-x86-google_apis-25,sys-img-x86-google_apis-28
# echo "y" | android update adb
# Create fake keymap file
RUN mkdir /usr/local/android-sdk/tools/keymaps && \
touch /usr/local/android-sdk/tools/keymaps/en-us
# Run sshd
RUN mkdir /var/run/sshd && \
echo "root:$ROOTPASSWORD" | chpasswd && \
sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config && \
sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd && \
echo "export VISIBLE=now" >> /etc/profile
ENV NOTVISIBLE "in users profile"
# Add entrypoint
ADD entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]