You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Dockerfile 3.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. FROM openjdk:8-jdk
  2. ENV DEBIAN_FRONTEND noninteractive
  3. ENV ANDROID_HOME /opt/android-sdk-linux
  4. ENV PATH ${PATH}:${ANDROID_HOME}/tools/bin:${ANDROID_HOME}/platform-tools:${PATH}:${ANDROID_HOME}/tools
  5. ENV ANDROID_NDK /opt/android-ndk-linux
  6. ENV ANDROID_NDK_HOME /opt/android-ndk-linux
  7. WORKDIR /opt
  8. RUN mkdir -p /opt/android-sdk-linux && mkdir -p ~/.android && touch ~/.android/repositories.cfg
  9. # Install dependencies
  10. RUN apt-get update && \
  11. apt-get install -yq supervisor curl unzip wget sudo maven libc6 libstdc++6 zlib1g libncurses5 make file --no-install-recommends && \
  12. apt-get clean
  13. RUN cd /opt/android-sdk-linux && \
  14. wget -q --output-document=sdk-tools.zip https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip && \
  15. unzip sdk-tools.zip && \
  16. rm -f sdk-tools.zip && \
  17. sdkmanager "cmake;3.6.4111459"
  18. RUN cd /opt/android-sdk-linux && \
  19. wget -q --output-document=sdk-platform-tools.zip 'https://dl.google.com/android/repository/platform-tools-latest-linux.zip' && \
  20. unzip sdk-platform-tools.zip && \
  21. rm -f sdk-platform-tools.zip
  22. RUN wget -q --output-document=android-ndk.zip https://dl.google.com/android/repository/android-ndk-r15c-linux-x86_64.zip && \
  23. unzip android-ndk.zip && \
  24. rm -f android-ndk.zip && \
  25. mv android-ndk-r15c android-ndk-linux
  26. RUN yes | sdkmanager --licenses
  27. # install Node JS (https://github.com/nodejs/docker-node/blob/90d5e3df903b830d039d3fe8f30e3a62395db37e/7.5/Dockerfile)
  28. RUN groupadd --gid 1000 node \
  29. && useradd --uid 1000 --gid node --shell /bin/bash --create-home node
  30. ENV NPM_CONFIG_LOGLEVEL info
  31. # that's the only version that doesn't hang on installing react-native-http inside docker
  32. ENV NODE_VERSION 8.9.1
  33. ENV NODE_ENV development
  34. RUN curl -SLO "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.xz" \
  35. && tar -xJf "node-v$NODE_VERSION-linux-x64.tar.xz" -C /usr/local --strip-components=1 \
  36. && rm "node-v$NODE_VERSION-linux-x64.tar.xz" \
  37. && ln -s /usr/local/bin/node /usr/local/bin/nodejs
  38. # END install Node JS
  39. # Support Gradle
  40. ENV TERM dumb
  41. # Install Lein
  42. # Check out latest releases from https://github.com/technomancy/leiningen/releases
  43. ENV LEIN_VERSION=2.8.1
  44. ENV LEIN_INSTALL=/usr/local/bin/
  45. RUN mkdir -p $LEIN_INSTALL \
  46. && wget -q https://raw.githubusercontent.com/technomancy/leiningen/$LEIN_VERSION/bin/lein-pkg \
  47. && mv lein-pkg $LEIN_INSTALL/lein \
  48. && chmod 0755 $LEIN_INSTALL/lein \
  49. && wget -q https://github.com/technomancy/leiningen/releases/download/$LEIN_VERSION/leiningen-$LEIN_VERSION-standalone.zip \
  50. && mkdir -p /usr/share/java \
  51. && mv leiningen-$LEIN_VERSION-standalone.zip /usr/share/java/leiningen-$LEIN_VERSION-standalone.jar
  52. # Install React-Native
  53. RUN npm install -g react-native-cli
  54. # Add files needed for installing dependencies
  55. # Use directory /build for that purpose
  56. WORKDIR /build
  57. ADD .env.jenkins .env
  58. ADD ./project.clj ./
  59. RUN lein deps
  60. ADD ./package.json package-lock.json ./
  61. RUN npm install
  62. ADD . ./
  63. RUN make setup
  64. RUN make prepare
  65. COPY supervisord.conf /etc/supervisord.conf
  66. RUN keytool -genkey -v -keystore status-im.keystore -storepass password -alias status -keyalg RSA -keysize 2048 -validity 10000 -dname "CN=mqttserver.ibm.com, OU=ID, O=IBM, L=Hursley, S=Hants, C=GB" -keypass password
  67. RUN mkdir -p /root/.gradle
  68. RUN mv status-im.keystore /root/.gradle/
  69. RUN ./android/gradlew --parallel -q -b android/build.gradle assembleRelease
  70. CMD ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf"]