mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-07 05:52:57 +00:00
build: optimize the Dockerfile
This commit is contained in:
30
Dockerfile
30
Dockerfile
@@ -24,12 +24,6 @@ ENV ANDROID_APIS="android-26" \
|
||||
### Set $PATH
|
||||
ENV PATH=$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin:$ANDROID_HOME/platform-tools:$ANDROID_HOME/build-tools/$ANDROID_BUILD_TOOLS_VERSION:$PATH
|
||||
|
||||
### Set working directory
|
||||
WORKDIR /app
|
||||
|
||||
### Add contents to working directory
|
||||
ADD . /app
|
||||
|
||||
### Replace shell with bash
|
||||
RUN rm /bin/sh && ln -s /bin/bash /bin/sh && \
|
||||
### Set debconf to run non-interactively
|
||||
@@ -84,15 +78,6 @@ RUN apt-get update -y && \
|
||||
RUN rm /etc/ssl/certs/java/cacerts && \
|
||||
update-ca-certificates -f
|
||||
|
||||
### Copy scripts directory into the tmp folder, so it's available to the following commands
|
||||
COPY $SCRIPTS_DIRECTORY/$NODE_SETUP_SCRIPT /tmp/
|
||||
|
||||
RUN bash /tmp/$NODE_SETUP_SCRIPT && apt-get install -y nodejs && \
|
||||
### Update npm to latest version
|
||||
npm install -g npm@$NPM_VERSION && \
|
||||
### Install needed npm packages
|
||||
npm install -g @ionic/cli@$IONIC_VERSION cordova@$CORDOVA_VERSION
|
||||
|
||||
### Install android
|
||||
RUN curl $ANDROID_SDK_TOOLS_DOWNLOAD_URL > /tmp/android-sdk.zip && \
|
||||
unzip /tmp/android-sdk.zip && \
|
||||
@@ -103,6 +88,21 @@ RUN curl $ANDROID_SDK_TOOLS_DOWNLOAD_URL > /tmp/android-sdk.zip && \
|
||||
### Install platform tools
|
||||
sdkmanager "platforms;$ANDROID_APIS" "build-tools;$ANDROID_BUILD_TOOLS_VERSION"
|
||||
|
||||
### Set working directory
|
||||
WORKDIR /app
|
||||
|
||||
### Add contents to working directory
|
||||
ADD . /app
|
||||
|
||||
### Copy scripts directory into the tmp folder, so it's available to the following commands
|
||||
COPY $SCRIPTS_DIRECTORY/$NODE_SETUP_SCRIPT /tmp/
|
||||
|
||||
RUN bash /tmp/$NODE_SETUP_SCRIPT && apt-get install -y nodejs && \
|
||||
### Update npm to latest version
|
||||
npm install -g npm@$NPM_VERSION && \
|
||||
### Install needed npm packages
|
||||
npm install -g @ionic/cli@$IONIC_VERSION cordova@$CORDOVA_VERSION
|
||||
|
||||
### Create, build, delete an empty cordova project to download necessary maven files and keep them in image
|
||||
RUN cordova create tmp-project && \
|
||||
cd tmp-project && \
|
||||
|
||||
Reference in New Issue
Block a user