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 | 34.0.0, 33.0.2, 33.0.1 |
Android SDK Platform | 33 |
Git | 2.34.1 |
Curl | 7.81.0 |
Jsonnet | 0.17.0 |
iputils-ping | |
dnsutils |
-
Initiate registration
docker run --rm -it -v /etc/gitlab-runner:/etc/gitlab-runner gitlab/gitlab-runner:latest register
Update
/etc/gitlab-runner
directory or use volume if you prefer to store the configuration in another place. -
Follow the registration steps.
-
On the
executor
configuration 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 image
todocker: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 image
tovenk0/android-sdk:latest
. Using this option no changes in the.gitlab-ci.yml
will 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:latest
Or 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-stopped
This 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
dev
Branch:- Whenever code changes are pushed to the
dev
branch, 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.