-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
39 lines (35 loc) · 1.82 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
FROM ubuntu:20.04
LABEL org.opencontainers.image.description Prebuild container setup for building react-native apk or aab
LABEL org.opencontainers.image.authors [email protected]
# set ARG to bypass dialog error \
# "debconf: unable to initialize frontend: Dialog debconf: (TERM is not set, so the dialog frontend is not usable.) debconf: falling back to frontend: Readline Configuring tzdata" \
# when installing git
ARG DEBIAN_FRONTEND=noninteractive
ARG TZ=Asia/Jakarta
ARG NODE_VERSION=16.x
ARG SDK_VERSION=7583922
ARG NDK_VERSION=21.4.7075529
ARG CMAKE_VERSION=3.10.2.4988404
ARG ANDROID_VERSION=android-31
ARG ANDROID_BUILD_TOOLS_VERSION=31.0.0
RUN apt update && apt install -y curl && \
curl -sL https://deb.nodesource.com/setup_${NODE_VERSION} | bash - && \
apt -y install gcc g++ make && apt update && \
apt install -y nodejs openjdk-11-jre-headless python3
RUN apt install -y expect git openjdk-11-jdk-headless wget unzip vim && \
wget https://dl.google.com/android/repository/commandlinetools-linux-${SDK_VERSION}_latest.zip
RUN mkdir -p Android/Sdk && unzip commandlinetools-linux-${SDK_VERSION}_latest.zip -d Android/Sdk/cmdline-tools && \
mv Android/Sdk/cmdline-tools/cmdline-tools Android/Sdk/cmdline-tools/latest
ENV ANDROID_HOME="$HOME/Android/Sdk"
ENV PATH="$PATH:$ANDROID_HOME/cmdline-tools/latest"
ENV PATH="$PATH:$ANDROID_HOME/cmdline-tools/latest/bin"
ENV PATH="$PATH:$ANDROID_HOME/platform-tools"
RUN yes | sdkmanager --sdk_root=${ANDROID_HOME} "tools"
RUN sdkmanager "platform-tools" "platforms;${ANDROID_VERSION}" "build-tools;${ANDROID_BUILD_TOOLS_VERSION}"
# If you use react-native-reanimated or react-native-mmkv-storage then install ndk & cmake
RUN sdkmanager --install "ndk;${NDK_VERSION}"
RUN sdkmanager --install "cmake;${CMAKE_VERSION}"
RUN sdkmanager --licenses
RUN corepack enable
RUN yarn --version
CMD ["/bin/sh"]