Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
yanivsetton authored Jul 7, 2019
1 parent 732471d commit a5906c0
Showing 1 changed file with 9 additions and 16 deletions.
25 changes: 9 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,53 +1,46 @@
FROM ubuntu:18.04
LABEL maintainer "[email protected]"
ARG GRADLE_VERSION=5.2.1
ARG KOTLIN_VERSION=1.3.21
ARG ANDROID_SDK_VERSION=4333796
RUN dpkg --add-architecture i386 && \
apt-get update -y && \
apt-get install -y --no-install-recommends libncurses5:i386 libc6:i386 libstdc++6:i386 lib32gcc1 lib32ncurses5 lib32z1 zlib1g:i386 && \
apt-get install -y --no-install-recommends openjdk-8-jdk && \
apt-get install -y --no-install-recommends git wget unzip && \
apt-get install -y --no-install-recommends qt5-default

# download and install Gradle
ARG GRADLE_VERSION=5.2.1

# Gradle
RUN cd /opt && \
wget -q https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-bin.zip && \
unzip gradle*.zip && \
ls -d */ | sed 's/\/*$//g' | xargs -I{} mv {} gradle && \
rm gradle*.zip

# download and install Kotlin compiler
ARG KOTLIN_VERSION=1.3.21
# Kotlin
RUN cd /opt && \
wget -q https://github.com/JetBrains/kotlin/releases/download/v${KOTLIN_VERSION}/kotlin-compiler-${KOTLIN_VERSION}.zip && \
unzip *kotlin*.zip && \
rm *kotlin*.zip

# download and install Android SDK
ARG ANDROID_SDK_VERSION=4333796
# Android SDK
ENV ANDROID_HOME /opt/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

# set the environment variables
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
ENV GRADLE_HOME /opt/gradle
ENV KOTLIN_HOME /opt/kotlinc
ENV PATH ${PATH}:${GRADLE_HOME}/bin:${KOTLIN_HOME}/bin:${ANDROID_HOME}/emulator:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools:${ANDROID_HOME}/tools/bin
ENV _JAVA_OPTIONS -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap
# WORKAROUND: for issue https://issuetracker.google.com/issues/37137213
ENV LD_LIBRARY_PATH ${ANDROID_HOME}/emulator/lib64:${ANDROID_HOME}/emulator/lib64/qt/lib

# accept the license agreements of the SDK components
ADD license_accepter.sh /opt/
RUN chmod +x /opt/license_accepter.sh && /opt/license_accepter.sh $ANDROID_HOME

# setup adb server
EXPOSE 5037

# install and configure SSH server
EXPOSE 22
# SSH server
ADD sshd-banner /etc/ssh/
ADD authorized_keys /tmp/
RUN apt-get update -y && \
Expand All @@ -73,7 +66,6 @@ ADD supervisord.conf /etc/supervisor/conf.d/
COPY /sdk/ /opt/android-sdk/
ENV USER root
ENV DISPLAY :1
EXPOSE 5901
ADD vncpass.sh /tmp/
ADD watchdog.sh /usr/local/bin/
ADD supervisord_vncserver.conf /etc/supervisor/conf.d/
Expand All @@ -87,5 +79,6 @@ RUN apt-get update -y && \
echo "DISPLAY=:1" >> $FILE_SSH_ENV
RUN cp -a $ANDROID_HOME/emulator/lib64/qt/lib/. /usr/lib/x86_64-linux-gnu/
RUN chmod +x /opt/license_accepter.sh && /opt/license_accepter.sh $ANDROID_HOME
EXPOSE 5037 5901 22
CMD /opt/license_accepter.sh $ANDROID_HOME; /usr/bin/supervisord

0 comments on commit a5906c0

Please sign in to comment.