Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Docker Android
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Zandor Smith
Docker Android
Commits
64011559
Unverified
Commit
64011559
authored
2 years ago
by
Nicola Corti
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Use Buck from Jitpack (#178)
parent
0954129e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.circleci/config.yml
+16
-0
16 additions, 0 deletions
.circleci/config.yml
.github/workflows/build.yaml
+0
-35
0 additions, 35 deletions
.github/workflows/build.yaml
Dockerfile
+7
-20
7 additions, 20 deletions
Dockerfile
scripts/test-react-native-setup.sh
+3
-3
3 additions, 3 deletions
scripts/test-react-native-setup.sh
with
26 additions
and
58 deletions
.circleci/config.yml
+
16
−
0
View file @
64011559
...
...
@@ -25,6 +25,21 @@ jobs:
nvm i node
node publish_docker.js
build
:
<<
:
*defaults
steps
:
-
checkout
-
run
:
*build-docker
-
run
:
name
:
Check if Emulator (Headless) starts
command
:
docker run --rm -v "$(pwd)/scripts/":/scripts react-native-community/react-native /bin/sh -c "/scripts/test-emulator-headless.sh"
-
run
:
name
:
Checkout React Native
command
:
git clone https://github.com/facebook/react-native.git
-
run
:
name
:
Build React Native
command
:
docker run --rm --ulimit nofile=10240 -v "$(pwd)/scripts/":/scripts -v "$(pwd)/react-native/":/react-native -w /react-native react-native-community/react-native /bin/sh -c "/scripts/test-react-native-setup.sh"
workflows
:
version
:
2
main
:
...
...
@@ -33,3 +48,4 @@ workflows:
filters
:
branches
:
only
:
master
-
build
This diff is collapsed.
Click to expand it.
.github/workflows/build.yaml
deleted
100644 → 0
+
0
−
35
View file @
0954129e
name
:
Build Docker image
on
:
push
:
paths
:
-
Dockerfile
tags-ignore
:
-
'
*.*'
pull_request
:
paths
:
-
Dockerfile
jobs
:
build
:
runs-on
:
ubuntu-22.04
env
:
IMAGE_TAG
:
react-native
steps
:
-
name
:
Checkout code
uses
:
actions/checkout@v2
-
name
:
Build Docker image
run
:
docker build --tag $IMAGE_TAG .
-
name
:
Check if Emulator (Headless) starts
run
:
docker run --rm -v "${GITHUB_WORKSPACE}/scripts/":/scripts $IMAGE_TAG /bin/sh -c "/scripts/test-emulator-headless.sh"
-
name
:
Checkout React Native
uses
:
actions/checkout@v2
with
:
repository
:
facebook/react-native
path
:
react-native
-
name
:
Build React Native
run
:
docker run --rm --ulimit nofile=10240 -v "${GITHUB_WORKSPACE}/scripts/":/scripts -v "${GITHUB_WORKSPACE}/react-native/":/react-native -w /react-native $IMAGE_TAG /bin/sh -c "/scripts/test-react-native-setup.sh"
This diff is collapsed.
Click to expand it.
Dockerfile
+
7
−
20
View file @
64011559
# build buck from source
FROM
ubuntu:20.04
AS
buck
ARG
BUCK_VERSION=2021.01.12.01
ENV
ANT_OPTS="-Xmx4096m"
RUN
apt update
&&
apt
install
-y
--no-install-recommends
\
ant
\
git
\
openjdk-11-jdk-headless
\
python-setuptools
\
python3-setuptools
# install buck by compiling it from source. We also remove the buck repo once it's built.
RUN
git clone
--depth
1
--branch
v
${
BUCK_VERSION
}
https://github.com/facebook/buck.git
\
&&
cd
buck
\
&&
ant
\
&&
./bin/buck build buck
--config
java.target_level
=
11
--config
java.source_level
=
11
--out
/tmp/buck.pex
# build react native image and use buck built from source from above stage
FROM
ubuntu:20.04
LABEL
Description="This image provides a base Android development environment for React Native, and may be used to run tests."
ENV
DEBIAN_FRONTEND=noninteractive
...
...
@@ -26,6 +9,7 @@ ENV DEBIAN_FRONTEND=noninteractive
ARG
SDK_VERSION=commandlinetools-linux-8512546_latest.zip
ARG
ANDROID_BUILD_VERSION=31
ARG
ANDROID_TOOLS_VERSION=31.0.0
ARG
BUCK_VERSION=2022.05.05.01
ARG
NDK_VERSION=21.4.7075529
ARG
NODE_VERSION=14.x
ARG
WATCHMAN_VERSION=4.9.0
...
...
@@ -41,8 +25,6 @@ ENV CMAKE_BIN_PATH=${ANDROID_HOME}/cmake/$CMAKE_VERSION/bin
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}
COPY
--from=buck /tmp/buck.pex /usr/local/bin/buck
# Install system dependencies
RUN
apt update
-qq
&&
apt
install
-qq
-y
--no-install-recommends
\
apt-transport-https
\
...
...
@@ -101,6 +83,11 @@ RUN curl -sL https://deb.nodesource.com/setup_${NODE_VERSION} | bash - \
&&
npm i
-g
yarn
\
&&
rm
-rf
/var/lib/apt/lists/
*
# download and install buck using the java11 pex from Jitpack
RUN curl -L https://jitpack.io/com/github/facebook/buck/v${BUCK_VERSION}/buck-v${BUCK_VERSION}-java11.pex -o /tmp/buck.pex \
&& mv /tmp/buck.pex /usr/local/bin/buck \
&& chmod +x /usr/local/bin/buck
# Full reference at https://dl.google.com/android/repository/repository2-1.xml
# download and unpack android
# workaround buck clang version detection by symlinking
...
...
This diff is collapsed.
Click to expand it.
scripts/test-react-native-setup.sh
+
3
−
3
View file @
64011559
...
...
@@ -13,7 +13,7 @@ buck build ReactAndroid/src/main/java/com/facebook/react/shell
echo
"Build React Native via Gradle"
yarn
install
./gradlew
--no-daemon
:ReactAndroid:packageReactNdkLibsForBuck
./gradlew
--no-daemon
:ReactAndroid:packageReactNdkLibsForBuck
-PreactNativeArchitectures
=
arm64-v8a
echo
"Assemble RNTester
app
"
./gradlew
--no-daemon
:packages:rn-tester:android:app:assembleRelease
echo
"Assemble RNTester
Release arm64-v8a
"
./gradlew
--no-daemon
:packages:rn-tester:android:app:assembleRelease
-PreactNativeArchitectures
=
arm64-v8a
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment