27 lines
1.7 KiB
Markdown
Raw Normal View History

2018-06-24 01:36:45 -05:00
# Docker F-Droid Build Environment
Self-contained build environment using F-Droid tools. This extends [docker-executable-fdroidserver](https://gitlab.com/fdroid/docker-executable-fdroidserver) with the latest [fdroiddata](https://gitlab.com/fdroid/fdroiddata) and the latest Android and Gradle SDKs.
The idea is to be able to add in your own app's configuration and build it with F-Droid's tooling.
2018-06-24 01:42:09 -05:00
See [Build Server Setup](https://f-droid.org/docs/Build_Server_Setup) on f-droid.org and [issue #370](https://gitlab.com/fdroid/fdroidserver/issues/370) on `fdroidserver` (Improve first time user experience of fdroid build).
2018-06-24 01:36:45 -05:00
## Building
`docker build -t fdroidbuild .`
The `fdroiddata` is placed into `/fdroiddata`.
## Try it yourself!
### Building from F-Droid Metadata
`docker run -v "$(pwd)/build:/fdroiddata/build" fdroidbuild build org.fdroid.fdroid -l`
Should produce the `org.fdroid.fdroid` apk in `build`.
### Building in Repo
If you have a directory named `fdroid` at the root of your repository, its contents will be copied over into the `/fdroiddata/metadata` directory. Additionally, the token `%REPO` in all metadata files will be replaced with the path to the repo in the container. This is so the metadata file does not need to know the exact path the repo will live at during the build.
A F-Droid metadata file is named `<appId>.txt` and [looks like this](https://gitlab.com/fdroid/fdroiddata/blob/master/templates/app-full). So, if you have such a file located at `fdroid/net.monarchpass.app.txt`, you should be able to run this:
2018-06-24 01:42:09 -05:00
`docker run -v "$(pwd)/build:/fdroiddata/build" -v "$(pwd):/repo" fdroidbuild build net.monarchpass.app.txt -l`
and build the latest version of that app.