Skip to content

Commit

Permalink
Build actions-runner image
Browse files Browse the repository at this point in the history
  • Loading branch information
bo0tzz authored Jan 9, 2024
1 parent c8b0796 commit 3516fe4
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/build-actions-runner.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Build and Push actions-runner Image

on:
push:
branches: [main]
pull_request:
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
packages: write

jobs:
build_and_push:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Login to GitHub Container Registry
uses: docker/[email protected]
if: ${{ !github.event.pull_request.head.repo.fork }}
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Generate docker image tags
id: metadata
uses: docker/metadata-action@v5
with:
flavor: |
# Disable latest tag
latest=false
images: |
name=ghcr.io/${{ github.repository_owner }}/actions-runner
- name: Build and push image
uses: docker/[email protected]
with:
context: ./containers/actions-runner
platforms: linux/amd64
push: ${{ !github.event.pull_request.head.repo.fork && steps.metadata.outputs.tags != '' }}
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
34 changes: 34 additions & 0 deletions containers/actions-runner/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Based on the image by onedr0p
# https://github.com/onedr0p/containers/blob/main/apps/actions-runner/Dockerfile
FROM ghcr.io/actions/actions-runner:2.311.0

ENV HOMEBREW_NO_ANALYTICS=1 \
HOMEBREW_NO_ENV_HINTS=1 \
HOMEBREW_NO_INSTALL_CLEANUP=1 \
DEBCONF_NONINTERACTIVE_SEEN=true \
DEBIAN_FRONTEND="noninteractive" \
APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=DontWarn

USER root

RUN \
apt-get update && apt-get upgrade -y \
&& \
apt-get install -y --no-install-recommends \
ca-certificates \
curl \
gcc \
git \
jo \
jq \
make \
moreutils \
unrar \
unzip \
wget \
zip \
&& rm -rf /var/lib/apt/lists/*

USER runner

RUN /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

0 comments on commit 3516fe4

Please sign in to comment.