Build an Android image for Orange Pi 4 with Docker


The Orange Pi 4 is a single board computer with the Rockchip RK3399. You can download the Android image from the official page, but if you want to customize it, you need to build the image yourself.

Required environment

--100GB or more free storage space --Docker environment

** Reference: My development environment ** Ryzen 3700X / 32GB RAM It may depend on the -jN option of make, but it seems that it consumes about 10GB of memory during the build.


  1. From Download ** Orange Pi 4B / Android Source Code **. It's best to download from countries other than China with Google Drive. The size is 16GB.

  2. Extract the source code Zip file Extract the dropped Android code to a suitable location.

  1. Combine / expand tar.gzaX Where there is rk3399-android-8.1.tar.gz *

    $ mkdir OrangePi_4
    $ cat rk3399-android-8.1.tar.gz* > rk3399-android-8.1.tar.gz
    $ tar xvf rk3399-android-8.1.tar.gz -C OrangePi_4
  2. Build!

    $ cd OrangePi_4/rk3399-android-8.1/
    $ docker run --rm -v $(pwd):/workdir aquahika/android-buildenv-orangepi4 ./ -F -M -u

In my environment it took about an hour to finish the build

  1. Deliverables Located at OrangePi_4 / rk3399-android-8.1 / rockdev / Image-rk3399_mid

    $ cd rockdev/Image-rk3399_mid
    $ ls
    boot.img           misc.img       pcba_small_misc.img  resource.img  uboot.img
    kernel.img         oem.img        pcba_whole_misc.img  system.img    update.img
    MiniLoaderAll.bin  parameter.txt  recovery.img         trust.img     vendor.img

I don't actually write it because I don't have OrangePi4 yet, but the build itself seems to be done well.

Parallel build settings for multi-core

The 11th line of OrangePi_4 / rk3399-android-8.1 / says MAKE = "make -j8", and it seems to build in parallel with 8 threads by default. My Ryzen 7 3700X has 8 cores and 16 threads, so I rewrote it to MAKE =" make -j16 ".

Build environment Docker image / Dockerfile

Issue / PR is welcome.

Recommended Posts

Build an Android image for Orange Pi 4 with Docker
Build an environment with Docker on AWS
[Rails] How to build an environment with Docker
[First team development ②] Build an environment with Docker
[Error resolution] Occurs when trying to build an environment for spring with docker
How to build docker environment with Gradle for intelliJ
Build an environment of Ruby2.7.x + Rails6.0.x + MySQL8.0.x with Docker
[Note] I suddenly can't build with Docker for windows.
(For myself) Build gitlab with ubuntu18.04 + docker for home (Note)
Build Spring for Android 2.0.0 environment
Post an image with POSTMAN
Build DynamoDB local with Docker
Maybe it works! Create an image with Docker and share it!
Build Docker Image lightweight and fast with CodeBuild with Santa Banner
(For myself) Build an IDE that you can touch from a browser with docker (trial)
Run lambda with custom docker image
[App development 0.5] [Node.js express Docker] Build an environment for Node.js Express MongoDB using Docker
Build Couchbase local environment with Docker
Build a Node.js environment with Docker
Build a SPA for Laravel 6.2 / Vue.js / Nginx / Mysql / Redis with Docker
Environment construction with Docker for beginners
Create an app catalog site using CLI for Microsoft 365 with Docker
Build PlantUML environment with VSCode + Docker
Build environment with vue.js + rails + docker
[Android Studio] Set an arbitrary image for the application background [Java]
Build a development environment for Django + MySQL + nginx with Docker Compose
Restart apache with docker php-apache image
Build docker + laravel environment with laradock
Build WebRTC Janus with Docker container
[Splunk] Build Splunk Enterprise (use docker image)
Spring Boot gradle build with Docker
Build debug environment on container --Build local development environment for Rails tutorial with Docker-
Build an environment of "API development + API verification using Swagger UI" with Docker
Build a local development environment for Rails tutorials with Docker (Rails 6 + PostgreSQL + Webpack)
Created a Docker container image for an OpenLDAP server based on Fedora
How to crop an image with libGDX
Build a PureScript development environment with Docker
Install Docker Desktop for Mac with Homebrew
Getting Started with Docker for Mac (Installation)
Proxy server with squid using docker image
Find Raspberry Pi from Android with mDNS
Build an authentication proxy server using Docker
Build a Wordpress development environment with Docker
Allow image posting with [Docker + WordPress + MySQL]
Image flew when updating Docker with WSL2
[Docker] Build Jupyter Lab execution environment with Docker
Build an Ultra96v2 development environment on Docker 1
Launched Redmine with Docker on Raspberry Pi 3
Time shift measures with Docker for Windows
Build TensorFlow operation check environment with Docker
How to build Rails 6 environment with Docker
Building an environment for WordPress, MySQL and phpMyAdmin with Docker Compose on EC2
[Workshop for beginners] Let's write an E2E test with Cloud9 + Docker Compose + Cypress!
How to build an environment of [TypeScript + Vue + Express + MySQL] with Docker ~ Vue edition ~
Build a development environment for Docker + Rails6 + Postgresql
I tried to verify AdoptOpenJDK 11 (11.0.2) with Docker image
Build a Laravel / Docker environment with VSCode devcontainer
[Android] Read from QR code image with zxing
I couldn't install docker with raspberry pi2 b +.
I made an Android app for MiRm service
Build an E2E test environment with Selenium (Java)