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
3c5a834a
Unverified
Commit
3c5a834a
authored
3 years ago
by
Dulmandakh
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
build buck from source and JDK 11 (#152)
parent
dcd240c5
No related branches found
Branches containing commit
Tags
v5.0
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Dockerfile
+21
-9
21 additions, 9 deletions
Dockerfile
with
21 additions
and
9 deletions
Dockerfile
+
21
−
9
View file @
3c5a834a
FROM
ubuntu:20.04
# 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
...
...
@@ -8,7 +25,6 @@ ENV DEBIAN_FRONTEND=noninteractive
ARG
SDK_VERSION=commandlinetools-linux-7302050_latest.zip
ARG
ANDROID_BUILD_VERSION=30
ARG
ANDROID_TOOLS_VERSION=30.0.3
ARG
BUCK_VERSION=2021.01.12.01
ARG
NDK_VERSION=21.4.7075529
ARG
NODE_VERSION=14.x
ARG
WATCHMAN_VERSION=4.9.0
...
...
@@ -19,10 +35,12 @@ ENV ANDROID_HOME=/opt/android
ENV
ANDROID_SDK_HOME=${ANDROID_HOME}
ENV
ANDROID_SDK_ROOT=${ANDROID_HOME}
ENV
ANDROID_NDK=${ANDROID_HOME}/ndk/$NDK_VERSION
ENV
JAVA_HOME=/usr/lib/jvm/java-
8
-openjdk-amd64
ENV
JAVA_HOME=/usr/lib/jvm/java-
11
-openjdk-amd64
ENV
PATH=${ANDROID_NDK}:${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
\
...
...
@@ -36,7 +54,6 @@ RUN apt update -qq && apt install -qq -y --no-install-recommends \
libgl1
\
libtcmalloc-minimal4
\
make
\
openjdk-8-jdk-headless
\
openjdk-11-jdk-headless
\
openssh-client
\
patch
\
...
...
@@ -80,11 +97,6 @@ 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 debian package
RUN
curl
-sS
-L
https://github.com/facebook/buck/releases/download/v
${
BUCK_VERSION
}
/buck.
${
BUCK_VERSION
}
_all.deb
-o
/tmp/buck.deb
\
&&
dpkg
-i
/tmp/buck.deb
\
&&
rm
/tmp/buck.deb
# 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.
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