Created
June 23, 2021 23:50
-
-
Save Tythos/3f86db635093a8b71a72d3e08cea5898 to your computer and use it in GitHub Desktop.
Dockerfile for cordova build environment supporting static file web applications
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# define base image and system tools | |
FROM fedora | |
RUN yum install unzip zip findutils which wget less -y | |
# install java | |
RUN yum install java-1.8.0-openjdk-devel -y | |
ENV JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk | |
# get gradle, android sdk | |
RUN curl -s "https://get.sdkman.io" | bash &&\ | |
source "$HOME/.sdkman/bin/sdkman-init.sh" &&\ | |
sdk install gradle | |
ENV ANDROID_HOME=/android | |
RUN wget https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip &&\ | |
unzip sdk-tools-linux-3859397.zip -d $ANDROID_HOME | |
ENV PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin | |
# install android sdk packages, dependencies | |
ENV ANDROID_VERSION=29 | |
ENV ANDROID_BUILDTOOLS_VERSION=27.0.3 | |
RUN yes | sdkmanager "build-tools;${ANDROID_BUILDTOOLS_VERSION}" | |
RUN yes | sdkmanager "platforms;android-${ANDROID_VERSION}" | |
RUN yes | sdkmanager "platform-tools" | |
# add node, install cordova | |
RUN yum install nodejs -y | |
RUN npm install -g cordova cordova-android | |
# populate SFWA "contents" | |
WORKDIR /app | |
COPY index.html . | |
# create cordova project and build | |
RUN mkdir /app/build &&\ | |
cd /app/build &&\ | |
cordova create . net.tythos.dev.cordovabox CordovaBox &&\ | |
cordova platform add android | |
# then, you can run: "cordova requirements" to verify | |
# then, you can run "cordova build" to build and export apk |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment