Same container image started multiple times using runs-on with matrix strategy
Bug report info
act version: 0.2.77
GOOS: darwin
GOARCH: arm64
NumCPU: 10
Docker host: DOCKER_HOST environment variable is not set
Sockets found:
/var/run/docker.sock
Config files:
/Users/development/Library/Application Support/act/actrc:
-P ubuntu-latest=catthehacker/ubuntu:act-latest
-P ubuntu-22.04=catthehacker/ubuntu:act-22.04
-P ubuntu-20.04=catthehacker/ubuntu:act-20.04
-P ubuntu-18.04=catthehacker/ubuntu:act-18.04
Build info:
Go version: go1.24.2
Module path: github.com/nektos/act
Main version: v0.2.78-0.20250504121323-324bab61f056
Main path: github.com/nektos/act
Main checksum:
Build settings:
-buildmode: exe
-compiler: gc
CGO_ENABLED: 1
CGO_CFLAGS:
CGO_CPPFLAGS:
CGO_CXXFLAGS:
CGO_LDFLAGS:
GOARCH: arm64
GOOS: darwin
GOARM64: v8.0
vcs: git
vcs.revision: 324bab61f056e7e103b142b4c2f8b3b34421d764
vcs.time: 2025-05-04T12:13:23Z
vcs.modified: false
Docker Engine:
Engine version: 27.5.1
Engine runtime: runc
Cgroup version: 2
Cgroup driver: cgroupfs
Storage driver: overlay2
Registry URI: https://index.docker.io/v1/
OS: OrbStack
OS type: linux
OS version:
OS arch: aarch64
OS kernel: 6.12.15-orbstack-00304-gd0ddcf70447d
OS CPU: 10
OS memory: 12008 MB
Security options:
name=seccomp,profile=builtin
name=cgroupns
Command used with act
act \
--pull=false \
-W test.yml \
-P ubuntu-24.04=runner-amd64:latest \
-P ubuntu-24.04-arm=runner-arm64:latest
Describe issue
When using a matrix strategy to set the runner (runs-on) dynamically and passing two separate images for these runners with -P, the same container is created twice. I would expect one amd64 and one arm64 container to be created.
In my test workflow, sometimes an amd64 runner container is created twice, sometimes arm64 is created twice, it seems to be random.
Link to GitHub repository
No response
Workflow content
name: Test
on:
workflow_dispatch:
jobs:
test-matrix:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-24.04
- os: ubuntu-24.04-arm
steps:
- run: |
echo "Running on OS: ${{ matrix.os }} $(arch)"
Relevant log output
[test.yml/test-matrix-1] โญ Run Set up job
[test.yml/test-matrix-2] โญ Run Set up job
[test.yml/test-matrix-1] ๐ Start image=runner-arm64:latest
[test.yml/test-matrix-2] ๐ Start image=runner-arm64:latest
[test.yml/test-matrix-1] ๐ณ docker pull image=runner-arm64:latest platform= username= forcePull=false
[test.yml/test-matrix-2] ๐ณ docker pull image=runner-arm64:latest platform= username= forcePull=false
[test.yml/test-matrix-1] ๐ณ docker create image=runner-arm64:latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host"
[test.yml/test-matrix-2] ๐ณ docker create image=runner-arm64:latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host"
[test.yml/test-matrix-1] ๐ณ docker run image=runner-arm64:latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host"
[test.yml/test-matrix-2] ๐ณ docker run image=runner-arm64:latest platform= entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host"
[test.yml/test-matrix-1] ๐ณ docker exec cmd=[node --no-warnings -e console.log(process.execPath)] user= workdir=
[test.yml/test-matrix-2] ๐ณ docker exec cmd=[node --no-warnings -e console.log(process.execPath)] user= workdir=
[test.yml/test-matrix-1] โ
Success - Set up job
[test.yml/test-matrix-1] ๐งช Matrix: map[os:ubuntu-24.04]
[test.yml/test-matrix-2] โ
Success - Set up job
[test.yml/test-matrix-2] ๐งช Matrix: map[os:ubuntu-24.04-arm]
[test.yml/test-matrix-1] โญ Run Main echo "Running on OS: ubuntu-24.04 $(arch)"
[test.yml/test-matrix-2] โญ Run Main echo "Running on OS: ubuntu-24.04-arm $(arch)"
[test.yml/test-matrix-1] ๐ณ docker exec cmd=[bash -e /var/run/act/workflow/0] user= workdir=
[test.yml/test-matrix-2] ๐ณ docker exec cmd=[bash -e /var/run/act/workflow/0] user= workdir=
| Running on OS: ubuntu-24.04 aarch64
[test.yml/test-matrix-1] โ
Success - Main echo "Running on OS: ubuntu-24.04 $(arch)"
[23.04475ms]
| Running on OS: ubuntu-24.04-arm aarch64
[test.yml/test-matrix-2] โ
Success - Main echo "Running on OS: ubuntu-24.04-arm $(arch)"
[22.976834ms]
[test.yml/test-matrix-1] โญ Run Complete job
[test.yml/test-matrix-1] Cleaning up container for job test-matrix
[test.yml/test-matrix-2] โญ Run Complete job
[test.yml/test-matrix-2] Cleaning up container for job test-matrix
[test.yml/test-matrix-1] โ
Success - Complete job
[test.yml/test-matrix-1] ๐ Job succeeded
[test.yml/test-matrix-2] โ
Success - Complete job
[test.yml/test-matrix-2] ๐ Job succeeded
Additional information
No response
[test.yml/test-matrix-1] ๐ณ docker pull image=runner-arm64:latest platform= username= forcePull=false [test.yml/test-matrix-2] ๐ณ docker pull image=runner-arm64:latest platform= username= forcePull=false | Running on OS: ubuntu-24.04 aarch64 [test.yml/test-matrix-1] โ Success - Main echo "Running on OS: ubuntu-24.04 $(arch)"
It seems act itself is doing right: starts a container and run the job for each of the os matrix. I guess you are unsatisfied about the two job all pulled ubuntu-24.04-arm64, but your host arch is arm64. So act running on docker itself cannot fully support amd64 arch. It's different from github actions which applies full virtualization.
Is it correct?