Skip to content

About

Custom Github Actions Hook for Docker Runners

Resources

Stars

9 stars

Watchers

1 watching

Forks

Repository files navigation

Github Runner Container Hooks

A Github Runner Container Docker Hook for DooD based on actions/runner-container-hooks

What is this about?

This is a custom runner container hook that can be used to execute docker containers in containerized self hosted runner environments. It is meant to be used in a Docker-out-of-Docker scenario (docker socket sharing) and addresses the issue of runner context sharing. With a DooD setup it is not posible to share the github runner context (workspace) with the docker runner container since the containers are created by the host:

Docker Ccntext Sharing

Usage

In your Github Actions Docker Runner Dockerfile:

FROM ghcr.io/alexander-heimbuch/github-runner-container-hooks:latest as runnerContainerHooks
COPY --from=runnerContainerHooks /static/runner_container_hooks.js /runner_container_hooks.js
# Adapt accordingly
ENV RUNNER_HOME=/home/docker/actions-runner/ 
ENV ACTIONS_RUNNER_CONTAINER_HOOKS=/runner_container_hooks.js

How it works

Instead of using the default system mounts this variant of Container Hooks creates a docker volume for each required context (_work, externals, _github_home and _github_workflow). Before a job starts the current job context is copied into the volume.

About

Custom Github Actions Hook for Docker Runners

Resources

Stars

9 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages