Dockerfile (1490B)
1 FROM ubuntu:jammy 2 3 # utilities 4 RUN apt-get update && \ 5 apt-get -y install apt-transport-https unzip curl usbutils --no-install-recommends && \ 6 rm -r /var/lib/apt/lists/* 7 8 # java 9 RUN apt-get update && \ 10 apt-get -y install software-properties-common && \ 11 add-apt-repository ppa:openjdk-r/ppa && \ 12 apt-get -y install openjdk-17-jdk-headless && \ 13 rm -r /var/lib/apt/lists/* 14 ENV JAVA_HOME /usr/lib/jvm/java-17-openjdk-amd64 15 16 # nodejs 17 RUN curl -sL https://deb.nodesource.com/setup_19.x | bash - && \ 18 apt-get update && \ 19 apt-get -y install nodejs --no-install-recommends && \ 20 rm -r /var/lib/apt/lists/* 21 22 # nativescript 23 RUN npm install -g nativescript@8.3.3 && \ 24 ns error-reporting disable && \ 25 ns usage-reporting disable 26 27 # android sdk 28 ENV ANDROID_HOME /opt/android-sdk 29 ENV PATH $PATH:$ANDROID_HOME/cmdline-tools/tools/bin:$ANDROID_HOME/platform-tools 30 # link from https://developer.android.com/studio -> Command line tools only 31 ADD https://dl.google.com/android/repository/commandlinetools-linux-9123335_latest.zip /tmp/cmdtools.zip 32 RUN mkdir -p /opt/android-sdk/cmdline-tools && \ 33 unzip /tmp/cmdtools.zip && \ 34 rm /tmp/cmdtools.zip && \ 35 mv cmdline-tools/ /opt/android-sdk/cmdline-tools/tools 36 RUN echo "y" | sdkmanager "tools" "platform-tools" "platforms;android-32" \ 37 "build-tools;33.0.0" 38 39 # gradle & example project 40 WORKDIR /tmp 41 RUN ns create example --js 42 WORKDIR /tmp/example 43 RUN ns build android 44 RUN rm -rf /tmp/example 45 46 WORKDIR /app