[GH-ISSUE #2764] Same container image started multiple times using runs-on with matrix strategy #1253

Open
opened 2026-03-01 21:49:57 +03:00 by kerem · 2 comments
Owner

Originally created by @cedws on GitHub (May 19, 2025).
Original GitHub issue: https://github.com/nektos/act/issues/2764

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.

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

Originally created by @cedws on GitHub (May 19, 2025). Original GitHub issue: https://github.com/nektos/act/issues/2764 ### Bug report info ```plain text 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 ```sh 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 ```yml 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 ```sh [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_
Author
Owner

@cupid5trick commented on GitHub (Jul 26, 2025):

[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?

<!-- gh-comment-id:3121135437 --> @cupid5trick commented on GitHub (Jul 26, 2025): > [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?
Author
Owner

@MadManRises commented on GitHub (Feb 17, 2026):

I am facing a very similar issue. Using a matrix strategy like this:

runs-on: ${{ matrix.platform }}

strategy:
  matrix:
    platform: [ubuntu-latest, windows-latest]

The jobs are always either both run on Windows or on Ubuntu. This looks like some sort of concurrency issue to me, where both jobs write/read the same variable cache.

Also, not necessarily the same issue, but this comment seems to indicate a very similar issue:
https://github.com/nektos/act/issues/5880#issuecomment-3144401224

<!-- gh-comment-id:3915290744 --> @MadManRises commented on GitHub (Feb 17, 2026): I am facing a very similar issue. Using a matrix strategy like this: ```yml runs-on: ${{ matrix.platform }} strategy: matrix: platform: [ubuntu-latest, windows-latest] ``` The jobs are always either both run on Windows or on Ubuntu. This looks like some sort of concurrency issue to me, where both jobs write/read the same variable cache. Also, not necessarily the same issue, but this comment seems to indicate a very similar issue: https://github.com/nektos/act/issues/5880#issuecomment-3144401224
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/act#1253
No description provided.