Android SDK image with minimal required set of tools for CI deployment. Does not contain emulator images to minimize the footprint.
Preinstalled tools/components:
| Tool/Component | Version |
|---|---|
| OpenJDK | 17 |
| Android SDK Build-Tools | 35.0.0, 34.0.0, 33.0.2, 33.0.1 |
| Android SDK Platform | 36 |
| Git | 2.43.0 |
| Curl | 8.5.0 |
| Jsonnet | 0.20.0 |
| GitLab CLI | 1.67.0 |
| jq | 1.7.1 |
| iputils-ping | 20240117 |
| dnsutils | 9.18.30 |
-
Initiate registration
docker run --rm -it -v /etc/gitlab-runner:/etc/gitlab-runner gitlab/gitlab-runner:latest register
Update
/etc/gitlab-runnerdirectory or use volume if you prefer to store the configuration in another place. -
Follow the registration steps.
-
On the
executorconfiguration step setdocker. -
Set default docker image. This step sets default docker image that will be used for runner executor when no image is specified in project CI configuration.
-
Option A. Set
docker imagetodocker:stable. This way you will be able to run any docker container with this runner. Specify the image in the.gitlab-ci.yml:image: venk0/android-sdk:latest
-
Option B. Set
docker imagetovenk0/android-sdk:latest. Using this option no changes in the.gitlab-ci.ymlwill be required.
-
Mount host directories with Gradle and SDK caches. Edit /etc/gitlab-runner/config.toml, set volumes as following:
volumes = ["/cache", "/srv/gitlab-runner-data/mnt/.gradle:/root/.gradle", "/srv/gitlab-runner-data/mnt/.android:/root/.android", "/srv/gitlab-runner-data/mnt/android-sdk/licenses/:/opt/android/licenses"]Update /srv/gitlab-runner-data/mnt directory or use volume if you prefer to store the data cache mounts in another place.
Run docker container:
docker run -v /etc/gitlab-runner:/etc/gitlab-runner \
-v /var/run/docker.sock:/var/run/docker.sock \
--name gitlab-runner --restart unless-stopped -d \
gitlab/gitlab-runner:latestOr use with docker-compose:
version: '3'
services:
gitlab-runner:
container_name: gitlab-runner
image: gitlab/gitlab-runner:latest
volumes:
- '/etc/gitlab-runner:/etc/gitlab-runner'
- '/var/run/docker.sock:/var/run/docker.sock'
restart: unless-stoppedThis repository contains a GitHub Actions workflow that automates the publishing of a Docker image for the Android SDK on DockerHub. The workflow is triggered under specific conditions:
-
Push Event to the
devBranch:- Whenever code changes are pushed to the
devbranch, the workflow will be triggered. - The Docker image will be built and published with the tag
edge, indicating an edge version of the image.
- Whenever code changes are pushed to the
-
Creation of a New Tag on Any Branch:
- When a new tag is created on any branch, the workflow will be triggered.
- The Docker image will be built and published with the following tags:
- A tag named
latest, indicating the latest stable version of the image. - A tag based on the name of the git tag that triggered the workflow.
- A tag named
It's important to note that the workflow excludes pull request events from triggering the build and push process, ensuring that Docker images are not published on pull requests. Additionally, the workflow is specific to the Dockerfile, meaning it only runs when changes are made to the Dockerfile in the repository.
Before using the workflow in your repository, ensure to properly configure the required secrets in the GitHub repository settings. The following secrets need to be set:
DOCKERHUB_USERNAME: Your DockerHub username.DOCKERHUB_TOKEN: An access token with the necessary permissions to publish images to your DockerHub repository.
The Dockerfiles and associated code and scripts are licensed under the Apache License 2.0.