Docker image for python-for-android based kivy build

685 views
Skip to first unread message

Ray Gallagher

unread,
Feb 19, 2019, 1:40:48 PM2/19/19
to Kivy users support
Hey folks. There are a few images for this, but I wasn't able to quite get them working for me, so I had an attempt at it. So far I've managed to use it to build and sign an APK which the Play Store accepted.

I've made a docker image specifically for packaging a kivy app into an APK, and optionally signing it. It's aimed specifically for the APK packaging bit, not the development bit, so it doesn't have android studio on it or anything.


What it does have is:

Ubuntu 16:04
Latest version (of Android SDK command line tools : 3.3.1
NDK version: r17c
Android build-tools: r28.0.3
python-for-android: 0.7.0
android platform 2.6

Most of the trouble I've experienced getting an APK built comes from the varying versions of apis etc which have changed over time. Docker is a nice way to get a point-in-time snapshot the whole stack. Well, the image is anyway. The Dockerfile used may well suffer from similar issues as time goes on.

It includes a single build run of a p4a distribution in order to minimize the downloading of external dependencies. Using the same distribution ("python2,android,kivy") for your app means you have a better chance of getting a working build. 

However, anyone familiar with the internals of p4a will know that this also limits the choices of what can be build using this image. 

The docker image is a fairly chunky 5GB and is here: https://hub.docker.com/r/gomyar/kivy-build
The Dockerfile used to create the image is here: https://github.com/gomyar/kivy-build

Instructions in the description for the image. I would be very interested to hear if this is of use or anyone's thoughts on how this might be improved.

thanks

Ray

André MIRAS

unread,
Feb 19, 2019, 4:37:36 PM2/19/19
to Kivy users support
Nice, thanks for sharing!

We actually also use a Docker container for testing & development purposes.
It's built automatically on master https://hub.docker.com/r/kivy/python-for-android
The image is 2GB and you can try it like this for instance:
docker run kivy/python-for-android /bin/sh -c '~/venv/bin/p4a --version'

The Dockerfile is currently hosted in the root directory of python-for-android.
You can see other way we use it in the `.travis.yml` file.

Cheers,

Andre

Ray Gallagher

unread,
Feb 20, 2019, 7:58:57 AM2/20/19
to Kivy users support
Oh very cool. I'll give it a go, thanks.

ZenCODE

unread,
Feb 21, 2019, 5:58:37 AM2/21/19
to Kivy users support
Nice. Thanks for sharing!
Reply all
Reply to author
Forward
Message has been deleted
0 new messages