actions / runner-container-hooks

Runner Container Hooks for GitHub Actions
MIT License
69 stars 44 forks source link

Base index.js not working with self-hosted docker rootless runner. #39

Closed dnewhook closed 1 year ago

dnewhook commented 1 year ago

Hi, I am trying to customize the containers used by jobs as defined in the documentation. I tried to build a simple workflow that uses the containerised 'hello-world-docker-action'. This step fails when using the default compiled index.js from this repo but succeeds when I unset the ACTIONS_RUNNER_CONTAINER_HOOKS environment variable on the runner.

I am using the latest runner (actions-runner-linux-x64-2.299.1) on a RHEL8 host. Here is my .env file for the runner. The runner user has docker rootless.

LANG=C.utf8
XDG_RUNTIME_DIR=/run/user/1008
DOCKER_HOST=unix:///run/user/1008/docker.sock
ACTIONS_RUNNER_CONTAINER_HOOKS=/home/actions/actions-runner/index.js

Here is my docker info.

Client:
 Context:    default
 Debug Mode: false
 Plugins:
  app: Docker App (Docker Inc., v0.9.1-beta3)
  buildx: Docker Buildx (Docker Inc., v0.9.1-docker)
  scan: Docker Scan (Docker Inc., v0.21.0)

Server:
 Containers: 3
  Running: 0
  Paused: 0
  Stopped: 3
 Images: 6
 Server Version: 20.10.21
 Storage Driver: fuse-overlayfs
 Logging Driver: json-file
 Cgroup Driver: none
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 1c90a442489720eec95342e1789ee8a5e1b9536f
 runc version: v1.1.4-0-g5fd4c4d
 init version: de40ad0
 Security Options:
  seccomp
   Profile: default
  rootless
 Kernel Version: 4.18.0-372.26.1.el8_6.x86_64
 Operating System: Red Hat Enterprise Linux 8.7 (Ootpa)
 OSType: linux
 Architecture: x86_64
 CPUs: 2
 Total Memory: 3.644GiB
 Name: xxxxxx
 ID: UVRM:7W3O:JIZ5:XWEV:QDZP:7QUY:UKGR:3V3R:PEFN:TSBY:R4HP:QSIB
 Docker Root Dir: /home/actions/.local/share/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

Can you help please?

nikola-jokic commented 1 year ago

Hi @dnewhook,

Thank you for submitting this issue! I will investigate it further and get back to you as soon as possible :relaxed: