Skip to content

Instantly share code, notes, and snippets.

@Scott31393
Created November 3, 2022 10:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Scott31393/dae3d912e14a85820eb0bebdcb642bcf to your computer and use it in GitHub Desktop.
Save Scott31393/dae3d912e14a85820eb0bebdcb642bcf to your computer and use it in GitHub Desktop.

Dockerfile - Build Android 11 (Rockchip)

Dockerfile:

FROM ubuntu:bionic

ENV DEBIAN_FRONTEND noninteractive

RUN apt-get update -y && apt-get install -y software-properties-common
RUN add-apt-repository -y ppa:deadsnakes/ppa
RUN apt-get update -y && apt-get install -y python3.8
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 150
RUN apt-get install -y python-pip && pip install pycrypto

RUN apt-get update -y && apt-get install -y openjdk-8-jdk python git-core gnupg flex bison gperf build-essential \
zip curl gawk liblz4-tool zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 \
lib32ncurses5 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache \
libgl1-mesa-dev libxml2-utils xsltproc unzip mtools u-boot-tools \
htop iotop sysstat iftop pigz bc device-tree-compiler lunzip \
dosfstools vim-common parted udev libssl-dev  sudo rsync python3-pyelftools cpio

RUN pip install pycrypto
ENV USER=android11-docker
ARG USER_ID=0
ARG GROUP_ID=0
RUN groupadd -g ${GROUP_ID} jenkins-docker && useradd -m -g jenkins-docker -u ${USER_ID} android11-docker

USER android11-docker

Build Docker Image:

docker build -t android-builder:11.x --build-arg USER_ID=`id -u` --build-arg GROUP_ID=`id -g` .

Run Android Builder:

docker run --rm -it -v ${PWD}:/workdir -v ~/.ssh:/home/android11-docker/.ssh:ro --workdir=/workdir <IMAGE ID>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment