Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running buildozer in docker #985

Closed
Tyrn opened this issue Oct 8, 2019 · 3 comments
Closed

Running buildozer in docker #985

Tyrn opened this issue Oct 8, 2019 · 3 comments
Labels

Comments

@Tyrn
Copy link

Tyrn commented Oct 8, 2019

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.

@tshirtman
Copy link
Member

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.

@Tyrn
Copy link
Author

Tyrn commented Oct 12, 2019

I did it like this:

  • Build basic image:
$ cd
$ git clone https://github.com/kivy/buildozer
$ cd buildozer
$ docker build --tag=buildozer .
$ docker run --volume "$(pwd)":/home/user/hostcwd buildozer --version
  • Create a project:
[pong]$ docker run --volume "$(pwd)":/home/user/hostcwd buildozer init
  • Edit buildozer.spec:
android.accept_sdk_license = True
  • Build:
[pong]$ docker run --volume "$(pwd)":/home/user/hostcwd buildozer android debug
  • Check the containers:
$ docker ps -a
  • Commit the container where the successful build happened, like this:
$ docker commit angry_black tyrn/buildozer:propio
$ docker images

The resulting image is about 5GB.

  • Run it like this on any project:
$ 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?

@github-actions
Copy link

👋 @Tyrn, we use the issue tracker exclusively for bug reports and feature requests. However, this issue appears to be a support request. Please use our support channels to get help with the project.
Let us know if this comment was made in error, and we'll be happy to reopen the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants