https://github.com/agregoreweb/gomobile-android-docker
Docker container with everything needed to build Go code for Android (APK and AAR / Native and SDK)
https://github.com/agregoreweb/gomobile-android-docker
android docker golang gomobile
Last synced: 3 months ago
JSON representation
Docker container with everything needed to build Go code for Android (APK and AAR / Native and SDK)
- Host: GitHub
- URL: https://github.com/agregoreweb/gomobile-android-docker
- Owner: AgregoreWeb
- License: apache-2.0
- Created: 2022-04-01T14:34:43.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-04-08T18:37:57.000Z (about 4 years ago)
- Last Synced: 2025-05-13T00:41:00.124Z (about 1 year ago)
- Topics: android, docker, golang, gomobile
- Language: Dockerfile
- Homepage:
- Size: 7.81 KB
- Stars: 7
- Watchers: 2
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE2
Awesome Lists containing this project
README
# gomobile Android builds... in Docker!
You can build native and SDK Android applications in Go, as described on [the wiki](https://github.com/golang/go/wiki/Mobile). That requires the Android SDK and NDK are installed and set up, at least for building SDK applications (.aar). This docker container installs all the required Android dependencies, as well as `gomobile`. This makes for much easier Android builds across multiple platforms and machines. It also allows for easy CI builds, like on GitHub Actions.
## Versions
- Go version: 1.17.8
- gomobile commit: 447654d
- Android platform version: 31
You can change these easily in the [Dockerfile](Dockerfile) and build your own container image. In the future, maybe multiple tags will be published to allow for different options.
## Usage
*Note: the image is 4.1 GB*
Enter the directory of your Go project, and then run:
```
docker run --rm -v "$PWD":/module makeworld/gomobile-android ...
```
Replace `...` with whatever arguments you'd provide to `gomobile` normally. For example:
```
docker run --rm -v "$PWD":/module makeworld/gomobile-android bind -target=android/arm -o test.aar .
```
`"$PWD"` means your current working directory, so `-v "$PWD":/module` mounts your working directory to `/module` in the docker container. If you want to specify the path to your Go project manually, you can do `-v /path/to/dir:/module` instead.
## License
This repo is dual-licensed under the MIT and APACHE2 licenses. Please see [LICENSE-MIT](LICENSE-MIT) and [LICENSE-APACHE2](LICENSE-APACHE2) for details.