diff --git a/android-sdk/Dockerfile b/android-sdk/Dockerfile index fdab7c3..9653725 100644 --- a/android-sdk/Dockerfile +++ b/android-sdk/Dockerfile @@ -51,7 +51,8 @@ RUN mkdir -p ${ANDROID_HOME}/cmdline-tools && \ rm *tools*linux*.zip # set the environment variables -ENV JAVA_HOME /usr/lib/jvm/java-${JDK_VERSION}-openjdk-amd64 +RUN JAVA_HOME=$(ls -d /usr/lib/jvm/java-${JDK_VERSION}-openjdk-* | head -n 1) && \ + echo "export JAVA_HOME=$JAVA_HOME" > /tmp/java_home.sh ENV GRADLE_HOME /opt/gradle ENV KOTLIN_HOME /opt/kotlinc ENV PATH ${PATH}:${GRADLE_HOME}/bin:${KOTLIN_HOME}/bin:${ANDROID_HOME}/cmdline-tools/latest/bin:${ANDROID_HOME}/cmdline-tools/tools/bin:${ANDROID_HOME}/platform-tools:${ANDROID_HOME}/emulator @@ -93,5 +94,9 @@ RUN apt-get update && \ done && \ (rm /tmp/*.pub 2> /dev/null || true) +ADD entrypoint.sh /tmp/entrypoint.sh +RUN chmod +x /tmp/entrypoint.sh +ENTRYPOINT ["/tmp/entrypoint.sh"] + ADD supervisord.conf /etc/supervisor/conf.d/ CMD ["/usr/bin/supervisord"] diff --git a/android-sdk/entrypoint.sh b/android-sdk/entrypoint.sh new file mode 100755 index 0000000..6c848aa --- /dev/null +++ b/android-sdk/entrypoint.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +if [ -f /tmp/java_home.sh ]; then + source /tmp/java_home.sh +fi + +exec "$@" \ No newline at end of file