I've built the buildozer app according to README
docker build --tag=buildozer .
docker run --volume "$(pwd)":/home/user/hostcwd buildozer --version
I ran this command in my project directory:
$ docker run --volume "$(pwd)":/home/user/hostcwd buildozer android debug
First time it downloaded all the SDKs, built a lot of dependencies and finally successfully built an apk file in pwd/bin, which is an easily expected behavior. I tried to build the same apk again with the same command line, expecting it to be reasonably fast, but it started the process of downloading SDKs again, which I aborted. What is the right way of running buildozer routinely the docker way?
I'm afraid, the README is a bit terse on docker. It'd be nice to tell explicitly where am I supposed to clone the buildozer which I intend to build with docker, where the big .buildozer should go, how to run buildozer correctly every time. Very close for me, but still no cigar. As I am not a docker expert I turned out to be unable to troubleshoot this minor nuisance.
Since you didn't rm your container, you can use docker start container_name to run it again, it'll still have everything it downloaded. You can use docker ps -a to ee all existing containers, the last column is their user friendly random name.
If you don't want to reuse containers, add --rm to the run command to automatically remove them, to avoid pile up to eat your disc space. And use more --volume options to save ~/.buildozer outside of the container and reuse it in next runs.
I did it like this:
$ cd
$ git clone https://github.com/kivy/buildozer
$ cd buildozer
$ docker build --tag=buildozer .
$ docker run --volume "$(pwd)":/home/user/hostcwd buildozer --version
[pong]$ docker run --volume "$(pwd)":/home/user/hostcwd buildozer init
buildozer.spec:android.accept_sdk_license = True
[pong]$ docker run --volume "$(pwd)":/home/user/hostcwd buildozer android debug
$ docker ps -a
$ docker commit angry_black tyrn/buildozer:propio
$ docker images
The resulting image is about 5GB.
$ docker run --volume "$(pwd)":/home/user/hostcwd tyrn/buildozer:propio android debug
Subsequent builds of the same project are fast. When I start yet another project, the first run still takes a lot of time: it builds about 1.2GB of local .buildozer directory from scratch. Is it by design, or is it my incompetence?
Most helpful comment
I did it like this:
buildozer.spec:The resulting image is about 5GB.
Subsequent builds of the same project are fast. When I start yet another project, the first run still takes a lot of time: it builds about 1.2GB of local
.buildozerdirectory from scratch. Is it by design, or is it my incompetence?