This README provides instructions on how to build and run a Docker container that includes the GitHub Actions runner, which can be registered to a GitHub repository.
To build the Docker image with a specific version of the GitHub Actions runner and target architecture, use the following command:
docker build --build-arg RUNNER_VERSION=2.277.1 \
--build-arg RUNNER_ARCH=x64 \
--tag github_runner_android:latest .
Replace 2.277.1
with the desired version of the GitHub Actions runner and x64
with the required architecture (e.g., x64
, arm64
, arm
).
RUNNER_VERSION
: The version of the GitHub Actions runner you want to install.RUNNER_ARCH
: The architecture of the runner. It can bex64
,arm64
, orarm
.
After building the image, you can run the container with the following command:
docker run --restart unless-stopped \
-e OWNER='your-github-username' \
-e REPOSITORY='your-repository-name' \
-e TOKEN='your-personal-access-token' \
-d github_runner_android:latest
Replace your-github-username
, your-repository-name
, and your-personal-access-token
with your GitHub username, the repository name where you want to register the runner, and your GitHub Personal Access Token (PAT), respectively.
OWNER
: The owner of the GitHub repository (user or organization).REPOSITORY
: The name of the repository where the runner will be registered.TOKEN
: A GitHub Personal Access Token with the necessary permissions to register a self-hosted runner.
--restart unless-stopped
: Ensures the container is always restarted unless it is manually stopped.-e
: Sets an environment variable inside the container.-d
: Runs the container in detached mode, meaning it runs in the background.
To stop the container from restarting, you can use the following Docker command:
docker stop <container-id>
To find the <container-id>
, use the docker ps
command to list all running containers.
To view the logs for the GitHub Actions runner, use the following command:
docker logs <container-id>
- Ensure that you have Docker installed and running on your system before executing these commands.
- Keep your personal access token confidential to protect your GitHub account.
- The
latest
tag is used as a convention, but you can tag the image with any name you prefer.
Refer to the official GitHub Actions documentation for more detailed information on self-hosted runners.