mirror of
https://github.com/HQarroum/docker-android.git
synced 2026-07-30 11:22:18 +00:00
Optimized Android images and replaced redir by Socat
This commit is contained in:
+11
-18
@@ -5,28 +5,20 @@ LABEL maintainer "Halim Qarroum <hqm.post@gmail.com>"
|
||||
LABEL description "A Docker image allowing to run an Android emulator"
|
||||
LABEL version "1.0.0"
|
||||
|
||||
# `redir.c` will be used to redirect
|
||||
# localhost ADB ports to the container interface.
|
||||
COPY deps/redir/redir.c /usr/src/redir.c
|
||||
|
||||
# Installing required packages.
|
||||
RUN apk update && \
|
||||
apk upgrade && \
|
||||
apk add --no-cache \
|
||||
alpine-sdk \
|
||||
bash \
|
||||
unzip \
|
||||
wget \
|
||||
libvirt-daemon \
|
||||
dbus \
|
||||
polkit \
|
||||
socat \
|
||||
virt-manager && \
|
||||
# Compile `redir`.
|
||||
gcc /usr/src/redir.c -o /usr/bin/redir && \
|
||||
strip /usr/bin/redir && \
|
||||
# Cleanup APK.
|
||||
apk del alpine-sdk && \
|
||||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /var/cache/apk/*
|
||||
rm -rf /tmp/* /var/tmp/* /var/cache/apk/*
|
||||
|
||||
# Arguments that can be overriden at build-time.
|
||||
ARG INSTALL_ANDROID_SDK=1
|
||||
@@ -49,7 +41,7 @@ ENV ANDROID_SDK_ROOT=/opt/android \
|
||||
QTWEBENGINE_DISABLE_SANDBOX=1 \
|
||||
ANDROID_EMULATOR_WAIT_TIME_BEFORE_KILL=10
|
||||
|
||||
# Exporting environment variables for keeping in the path
|
||||
# Exporting environment variables to keep in the path
|
||||
# Android SDK binaries and shared libraries.
|
||||
ENV PATH "${PATH}:${ANDROID_SDK_ROOT}/platform-tools"
|
||||
ENV PATH "${PATH}:${ANDROID_SDK_ROOT}/emulator"
|
||||
@@ -70,16 +62,17 @@ RUN mkdir /root/.android/ && \
|
||||
# Exporting ADB keys.
|
||||
COPY keys/* /root/.android/
|
||||
|
||||
# Copy the startup scripts.
|
||||
COPY scripts/* /opt/
|
||||
|
||||
# Make the scripts executable.
|
||||
RUN chmod +x /opt/*.sh
|
||||
|
||||
# This layer will download the Android command-line tools
|
||||
# The following layers will download the Android command-line tools
|
||||
# to install the Android SDK, emulator and system images.
|
||||
# It will then install the Android SDK and emulator.
|
||||
COPY scripts/install-sdk.sh /opt/
|
||||
RUN chmod +x /opt/install-sdk.sh
|
||||
RUN /opt/install-sdk.sh
|
||||
|
||||
# Copy the container scripts in the image.
|
||||
COPY scripts/start-emulator.sh /opt/
|
||||
COPY scripts/emulator-monitoring.sh /opt/
|
||||
RUN chmod +x /opt/*.sh
|
||||
|
||||
# Set the entrypoint
|
||||
ENTRYPOINT ["/opt/start-emulator.sh"]
|
||||
Reference in New Issue
Block a user