Repository navigation
How to make act use a specific Docker image instead of the default one? #6192
|
My workflow uses I know about Is there a middle ground? Like a medium-sized image that has the common tools but isn't 12GB? Or can I build my own image that just adds what I need on top of the default? What do people actually use in practice? The act README lists the image options but doesn't recommend which one to pick for a workflow that needs standard CLI tools. |
Replies: 2 comments
|
Yes. You have three practical options, and I would not jump straight to the For the middle ground, use the act -P ubuntu-22.04=ghcr.io/catthehacker/ubuntu:act-22.04That image is documented by If your workflow mostly needs a few missing CLI tools, I would usually build a small project image on top of the FROM ghcr.io/catthehacker/ubuntu:act-22.04
RUN apt-get update \
&& apt-get install -y --no-install-recommends jq awscli \
&& rm -rf /var/lib/apt/lists/*Build and map it: docker build -t local/act-ubuntu-22.04-tools .
act -P ubuntu-22.04=local/act-ubuntu-22.04-toolsIf you use this regularly, put the platform mapping in One caveat: if a job depends on exact GitHub-hosted runner paths, preinstalled SDK versions, browser stacks, Android tooling, etc., the If this resolves your setup, please mark it as the answer so other |
|
building a custom image on top of the slim one is the way to go then. thanks for the Dockerfile example |
Yes. You have three practical options, and I would not jump straight to the
full-*image unless you really need parity with the hosted runner.For the middle ground, use the
act-*image:That image is documented by
catthehacker/docker_imagesas the medium-size image used bynektos/act, intended to keep compatibility with most actions while staying much smaller than the hosted-runner copy. Thefull-22.04image is the near-hosted-runner copy and is expected to be huge.If your workflow mostly needs a few missing CLI tools, I would usually build a small project image on top of the
actimage instead of pullingfull:FROM ghcr.io/catthe…