1
- # build buck from source
2
- FROM ubuntu:20.04 AS buck
3
-
4
- ARG BUCK_VERSION=2021.01.12.01
5
- ENV ANT_OPTS="-Xmx4096m"
6
- RUN apt update && apt install -y --no-install-recommends \
7
- ant \
8
- git \
9
- openjdk-11-jdk-headless \
10
- python-setuptools \
11
- python3-setuptools
12
- # install buck by compiling it from source. We also remove the buck repo once it's built.
13
- RUN git clone --depth 1 --branch v${BUCK_VERSION} https://github.com/facebook/buck.git \
14
- && cd buck \
15
- && ant \
16
- && ./bin/buck build buck --config java.target_level=11 --config java.source_level=11 --out /tmp/buck.pex
17
-
18
- # build react native image and use buck built from source from above stage
19
1
FROM ubuntu:20.04
2
+
20
3
LABEL Description="This image provides a base Android development environment for React Native, and may be used to run tests."
21
4
22
5
ENV DEBIAN_FRONTEND=noninteractive
@@ -26,6 +9,7 @@ ENV DEBIAN_FRONTEND=noninteractive
26
9
ARG SDK_VERSION=commandlinetools-linux-8512546_latest.zip
27
10
ARG ANDROID_BUILD_VERSION=31
28
11
ARG ANDROID_TOOLS_VERSION=31.0.0
12
+ ARG BUCK_VERSION=2022.05.05.01
29
13
ARG NDK_VERSION=21.4.7075529
30
14
ARG NODE_VERSION=14.x
31
15
ARG WATCHMAN_VERSION=4.9.0
@@ -41,8 +25,6 @@ ENV CMAKE_BIN_PATH=${ANDROID_HOME}/cmake/$CMAKE_VERSION/bin
41
25
42
26
ENV PATH=${ANDROID_NDK}:${CMAKE_BIN_PATH}:${ANDROID_HOME}/cmdline-tools/latest/bin:${ANDROID_HOME}/emulator:${ANDROID_HOME}/platform-tools:${ANDROID_HOME}/tools:${ANDROID_HOME}/tools/bin:/opt/buck/bin/:${PATH}
43
27
44
- COPY --from=buck /tmp/buck.pex /usr/local/bin/buck
45
-
46
28
# Install system dependencies
47
29
RUN apt update -qq && apt install -qq -y --no-install-recommends \
48
30
apt-transport-https \
@@ -101,6 +83,11 @@ RUN curl -sL https://deb.nodesource.com/setup_${NODE_VERSION} | bash - \
101
83
&& npm i -g yarn \
102
84
&& rm -rf /var/lib/apt/lists/*
103
85
86
+ # download and install buck using the java11 pex from Jitpack
87
+ RUN curl -L https://jitpack.io/com/github/facebook/buck/v${BUCK_VERSION}/buck-v${BUCK_VERSION}-java11.pex -o /tmp/buck.pex \
88
+ && mv /tmp/buck.pex /usr/local/bin/buck \
89
+ && chmod +x /usr/local/bin/buck
90
+
104
91
# Full reference at https://dl.google.com/android/repository/repository2-1.xml
105
92
# download and unpack android
106
93
# workaround buck clang version detection by symlinking
0 commit comments