Skip to content

Simple image based on Alpine Linux for compiling Android NDK projects using ndk-build

Notifications You must be signed in to change notification settings

sraillard/docker-alpine-android-ndk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Using the prebuilt image

The public Docker Hub repository is here: https://hub.docker.com/r/sraillard/alpine-android-ndk/

Get the image:

docker pull sraillard/alpine-android-ndk:r18

To compile a project: (clean after exit with --rm and bind mount a local path)

docker run -rm --mount source=/path/to/ndk/project/,destination=/source,type=bind --workdir=/source sraillard/alpine-android-ndk:r18 ndk-build

Dependencies

Step by step build

Launch a shell from the Alpine Linux container:

docker pull alpine
docker run -it alpine

In the container shell:

apk add --no-cache nano bash make file
mkdir /ndk
cd /ndk
wget -O ndk.zip https://dl.google.com/android/repository/android-ndk-r18-linux-x86_64.zip
unzip ndk.zip
rm ndk.zip
wget https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub -O /etc/apk/keys/sgerrand.rsa.pub
wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.28-r0/glibc-2.28-r0.apk -O /tmp/glibc.apk
wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.28-r0/glibc-bin-2.28-r0.apk -O /tmp/glibc-bin.apk
apk add --no-cache /tmp/glibc.apk /tmp/glibc-bin.apk
rm /tmp/glibc.apk /tmp/glibc-bin.apk
exit

Save the container modifications:

docker ps -a (get the container ID)
docker commit ID test-ndk

Test: compile a NDK project:

 docker run --mount source=/path/to/ndk/project/,destination=/source,type=bind --workdir=/source test-ndk /ndk/android-ndk-r18/ndk-build

About

Simple image based on Alpine Linux for compiling Android NDK projects using ndk-build

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published