[GH-ISSUE #692] Issue: act -P flag not working to switch platform/image #439

Closed
opened 2026-03-01 21:43:24 +03:00 by kerem · 9 comments
Owner

Originally created by @danbadds38 on GitHub (May 19, 2021).
Original GitHub issue: https://github.com/nektos/act/issues/692

Originally assigned to: @catthehacker on GitHub.

Act version

commit version 29ea8cfc4e00401b144cd29643a61ca089efd7e9

act version 0.2.22

Expected behavior

to use ubuntu-18.04=nektos/act-environments-ubuntu:18.04

Actual behavior

uses image=node:12.20.1-buster-slim

user@GT192:~/code/drm-docker/drm-case-v2$ act --platform ubuntu-18.04=nektos/act-environments-ubuntu:18.04
[Docker CI & Codeception Suite/build] 🚀  Start image=node:12.20.1-buster-slim
[Docker CI & Codeception Suite/build] 🐳  docker run image=node:12.20.1-buster-slim platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[Docker CI & Codeception Suite/build] ⭐  Run actions/checkout@v2

~/.actrc dump

user@GT192:~/code/drm-docker/drm-case-v2$ cat ~/.actrc 
-P ubuntu-18.04=nektos/act-environments-ubuntu:18.04

Workflow and/or repository

workflow
name: example workflow

on: [push]

jobs:
  [...]

Steps to reproduce

Choose Large Image

user@GT192:~/code/drm-docker/drm-case-v2$ act -n
? Please choose the default image you want to use with act:

  - Large size image: +20GB Docker image, includes almost all tools used on GitHub Actions (IMPORTANT: currently only ubuntu-18.04 platform is available)
  - Medium size image: ~500MB, includes only necessary tools to bootstrap actions and aims to be compatible with all actions
  - Micro size image: <200MB, contains only NodeJS required to bootstrap actions, doesn't work with all actions

Default image and other options can be changed manually in ~/.actrc (please refer to https://github.com/nektos/act#configuration for additional information about file structure) Large
*DRYRUN* [Docker CI & Codeception Suite/build] 🚀  Start image=node:12.20.1-buster-slim
*DRYRUN* [Docker CI & Codeception Suite/build]   🐳  docker run image=node:12.20.1-buster-slim platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
*DRYRUN* [Docker CI & Codeception Suite/build] ⭐  Run actions/checkout@v2
*DRYRUN* [Docker CI & Codeception Suite/build]   ☁  git clone 'https://github.com/actions/checkout' # ref=v2
*DRYRUN* [Docker CI & Codeception Suite/build]   ✅  Success - actions/checkout@v2
*DRYRUN* [Docker CI & Codeception Suite/build] ⭐  Run Deploy Dockerized Environment & Run Integration Tests.
*DRYRUN* [Docker CI & Codeception Suite/build]   ✅  Success - Deploy Dockerized Environment & Run Integration Tests.

act output

Log
PASTE YOUR LOG HERE
Originally created by @danbadds38 on GitHub (May 19, 2021). Original GitHub issue: https://github.com/nektos/act/issues/692 Originally assigned to: @catthehacker on GitHub. <!-- - Make sure you are able to reproduce it on the [latest version](https://github.com/nektos/act/releases) - Search the existing issues. - Refer to [README](https://github.com/nektos/act/blob/master/README.md). --> ## Act version <!-- - Paste output of `act --version` inside the code block below - If you've built `act` yourself, please provide commit hash --> ```none commit version 29ea8cfc4e00401b144cd29643a61ca089efd7e9 act version 0.2.22 ``` ## Expected behavior ```none to use ubuntu-18.04=nektos/act-environments-ubuntu:18.04 ``` <!-- - Describe how whole process should go and finish --> ## Actual behavior uses image=node:12.20.1-buster-slim ```none user@GT192:~/code/drm-docker/drm-case-v2$ act --platform ubuntu-18.04=nektos/act-environments-ubuntu:18.04 [Docker CI & Codeception Suite/build] 🚀 Start image=node:12.20.1-buster-slim [Docker CI & Codeception Suite/build] 🐳 docker run image=node:12.20.1-buster-slim platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] [Docker CI & Codeception Suite/build] ⭐ Run actions/checkout@v2 ``` `~/.actrc dump` ```none user@GT192:~/code/drm-docker/drm-case-v2$ cat ~/.actrc -P ubuntu-18.04=nektos/act-environments-ubuntu:18.04 ``` <!-- - Describe the issue --> ## Workflow and/or repository <!-- - Provide workflow with which we can reproduce the issue OR - Provide link to your GitHub repository that contains the workflow --> <details> <summary>workflow</summary> ```none name: example workflow on: [push] jobs: [...] ``` </details> ## Steps to reproduce Choose Large Image ```none user@GT192:~/code/drm-docker/drm-case-v2$ act -n ? Please choose the default image you want to use with act: - Large size image: +20GB Docker image, includes almost all tools used on GitHub Actions (IMPORTANT: currently only ubuntu-18.04 platform is available) - Medium size image: ~500MB, includes only necessary tools to bootstrap actions and aims to be compatible with all actions - Micro size image: <200MB, contains only NodeJS required to bootstrap actions, doesn't work with all actions Default image and other options can be changed manually in ~/.actrc (please refer to https://github.com/nektos/act#configuration for additional information about file structure) Large *DRYRUN* [Docker CI & Codeception Suite/build] 🚀 Start image=node:12.20.1-buster-slim *DRYRUN* [Docker CI & Codeception Suite/build] 🐳 docker run image=node:12.20.1-buster-slim platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] *DRYRUN* [Docker CI & Codeception Suite/build] ⭐ Run actions/checkout@v2 *DRYRUN* [Docker CI & Codeception Suite/build] ☁ git clone 'https://github.com/actions/checkout' # ref=v2 *DRYRUN* [Docker CI & Codeception Suite/build] ✅ Success - actions/checkout@v2 *DRYRUN* [Docker CI & Codeception Suite/build] ⭐ Run Deploy Dockerized Environment & Run Integration Tests. *DRYRUN* [Docker CI & Codeception Suite/build] ✅ Success - Deploy Dockerized Environment & Run Integration Tests. ``` <!-- - Make sure to include full command with parameters you used to run `act`, example: 1. Clone example repo (https://github.com/cplee/github-actions-demo) 2. Enter cloned repo directory 3. Run `act -s SUPER_SECRET=im-a-value` --> ## `act` output <!-- - Use `act` with `-v`/`--verbose` and paste output from your terminal in code block below --> <details> <summary>Log</summary> ```none PASTE YOUR LOG HERE ``` </details>
kerem 2026-03-01 21:43:24 +03:00
Author
Owner

@catthehacker commented on GitHub (May 22, 2021):

Can please post full workflow you are trying to run?

<!-- gh-comment-id:846464878 --> @catthehacker commented on GitHub (May 22, 2021): Can please post full workflow you are trying to run?
Author
Owner

@github-actions[bot] commented on GitHub (Jun 22, 2021):

Issue is stale and will be closed in 14 days unless there is new activity

<!-- gh-comment-id:865426779 --> @github-actions[bot] commented on GitHub (Jun 22, 2021): Issue is stale and will be closed in 14 days unless there is new activity
Author
Owner

@mshriver commented on GitHub (Jul 1, 2021):

@catthehacker I'm also seeing this behavior running against 0.2.23. Both choosing large when prompted, or using the -P option to run with the largest image available.

Observing this trying to run the workflow being updated in this PR with act pull_request:
https://github.com/SatelliteQE/broker/pull/116/files#diff-63bd641104d10e25f141d518a16b22a151d125e12701df2f9e79734b23b90188

With no ~/.actrc file defined:

setup@localhost:~/repos/broker (jaryn-gh-actions$=) % act -P ubuntu-20.04=catthehacker/ubuntu:full-20.04 pull_request
[CodeQL/CodeQL Analysis-2] 🧪  Matrix: map[python-version:3.9]
[CodeQL/CodeQL Analysis-2] 🚀  Start image=node:12-buster-slim

With selecting Large when prompted at runtime:

setup@localhost:~/repos/broker (jaryn-gh-actions$=) % act pull_request 
? Please choose the default image you want to use with act:
<shorter>
Default image and other options can be changed manually in ~/.actrc (please refer to https://github.com/nektos/act#configuration for additional information about file structure) Large
[CodeQL/CodeQL Analysis-2] 🧪  Matrix: map[python-version:3.9]
[CodeQL/CodeQL Analysis-2] 🚀  Start image=node:12-buster-slim

With ~/.actrc having been written by the previous run:

setup@localhost:~/repos/broker (jaryn-gh-actions$=) % cat ~/.actrc
-P ubuntu-18.04=nektos/act-environments-ubuntu:18.04
setup@localhost:~/repos/broker (jaryn-gh-actions$=) % act pull_request
[CodeQL/CodeQL Analysis-1] 🧪  Matrix: map[python-version:3.9]
[CodeQL/CodeQL Analysis-1] 🚀  Start image=node:12-buster-slim
<!-- gh-comment-id:872504674 --> @mshriver commented on GitHub (Jul 1, 2021): @catthehacker I'm also seeing this behavior running against 0.2.23. Both choosing large when prompted, or using the -P option to run with the largest image available. Observing this trying to run the workflow being updated in this PR with `act pull_request`: https://github.com/SatelliteQE/broker/pull/116/files#diff-63bd641104d10e25f141d518a16b22a151d125e12701df2f9e79734b23b90188 **With no `~/.actrc` file defined:** ``` setup@localhost:~/repos/broker (jaryn-gh-actions$=) % act -P ubuntu-20.04=catthehacker/ubuntu:full-20.04 pull_request [CodeQL/CodeQL Analysis-2] 🧪 Matrix: map[python-version:3.9] [CodeQL/CodeQL Analysis-2] 🚀 Start image=node:12-buster-slim ``` **With selecting `Large` when prompted at runtime:** ``` setup@localhost:~/repos/broker (jaryn-gh-actions$=) % act pull_request ? Please choose the default image you want to use with act: <shorter> Default image and other options can be changed manually in ~/.actrc (please refer to https://github.com/nektos/act#configuration for additional information about file structure) Large [CodeQL/CodeQL Analysis-2] 🧪 Matrix: map[python-version:3.9] [CodeQL/CodeQL Analysis-2] 🚀 Start image=node:12-buster-slim ``` **With `~/.actrc` having been written by the previous run:** ``` setup@localhost:~/repos/broker (jaryn-gh-actions$=) % cat ~/.actrc -P ubuntu-18.04=nektos/act-environments-ubuntu:18.04 setup@localhost:~/repos/broker (jaryn-gh-actions$=) % act pull_request [CodeQL/CodeQL Analysis-1] 🧪 Matrix: map[python-version:3.9] [CodeQL/CodeQL Analysis-1] 🚀 Start image=node:12-buster-slim ```
Author
Owner

@ChristopherHX commented on GitHub (Jul 2, 2021):

@mshriver You haven't specified ubuntu-18.04 or ubuntu-20.04 in your workflow, but used ubuntu-latest.

The bug?
There is no large image for ubuntu-latest so it seems to use the small one. Maybe change the image survey of act to not choose the small image if large was selected, use medium instead for ubuntu-latest, ubuntu-18.04 and ubuntu-20.04 or remove the defaults (small image) and show as unsupported in the log instead

Not affected:

With no ~/.actrc file defined:

Fix your parameter to match runs-on of your workflow

setup@localhost:~/repos/broker (jaryn-gh-actions$=) % act -P ubuntu-latest=catthehacker/ubuntu:full-20.04 pull_request

You can use multiple images in multiple jobs and ubuntu-latest is not 100% equal to ubuntu-18.04 or ubuntu-20.04 and that changes every two years.

<!-- gh-comment-id:872848010 --> @ChristopherHX commented on GitHub (Jul 2, 2021): @mshriver You haven't specified `ubuntu-18.04` or `ubuntu-20.04` in your workflow, but used `ubuntu-latest`. **The bug?** There is no large image for `ubuntu-latest` so it seems to use the small one. Maybe change the image survey of act to not choose the small image if large was selected, use medium instead for `ubuntu-latest`, `ubuntu-18.04` and `ubuntu-20.04` or remove the defaults (small image) and show as unsupported in the log instead Not affected: > With no ~/.actrc file defined: Fix your parameter to match runs-on of your workflow ``` setup@localhost:~/repos/broker (jaryn-gh-actions$=) % act -P ubuntu-latest=catthehacker/ubuntu:full-20.04 pull_request ``` You can use multiple images in multiple jobs and `ubuntu-latest` is not 100% equal to `ubuntu-18.04` or `ubuntu-20.04` and that changes every two years.
Author
Owner

@catthehacker commented on GitHub (Jul 2, 2021):

that's the problem with large image, it's heavily outdated and it's only ubuntu 18.04, I'm still working on making an equivalent to that

<!-- gh-comment-id:872861940 --> @catthehacker commented on GitHub (Jul 2, 2021): that's the problem with large image, it's heavily outdated and it's only ubuntu 18.04, I'm still working on making an equivalent to that
Author
Owner

@mshriver commented on GitHub (Jul 2, 2021):

@ChristopherHX Good spot, thanks! Adjusting my argument so that my workflow's reference matches the argument reference (ubuntu-latest) got act to use the correct image.

<!-- gh-comment-id:872960569 --> @mshriver commented on GitHub (Jul 2, 2021): @ChristopherHX Good spot, thanks! Adjusting my argument so that my workflow's reference matches the argument reference (`ubuntu-latest`) got `act` to use the correct image.
Author
Owner

@github-actions[bot] commented on GitHub (Aug 2, 2021):

Issue is stale and will be closed in 14 days unless there is new activity

<!-- gh-comment-id:890612375 --> @github-actions[bot] commented on GitHub (Aug 2, 2021): Issue is stale and will be closed in 14 days unless there is new activity
Author
Owner

@catthehacker commented on GitHub (Aug 9, 2021):

large images have been updated and include ubuntu-latest/ubuntu-20.04

as for the original issue, I'm unsure why that happens, I suspect wrong platform used in workflow but until that is confirmed by author, I'm closing the issue

<!-- gh-comment-id:895548657 --> @catthehacker commented on GitHub (Aug 9, 2021): `large` images have been updated and include `ubuntu-latest`/`ubuntu-20.04` as for the original issue, I'm unsure why that happens, I suspect wrong platform used in workflow but until that is confirmed by author, I'm closing the issue
Author
Owner

@sminf commented on GitHub (Nov 14, 2021):

Configure multiple ubuntu images in ~/.actrc.

-P ubuntu-latest=ghcr.io/catthehacker/ubuntu:full-latest
-P ubuntu-18.04=ghcr.io/catthehacker/ubuntu:full-18.04
-P ubuntu-20.04=ghcr.io/catthehacker/ubuntu:full-20.04
<!-- gh-comment-id:968263146 --> @sminf commented on GitHub (Nov 14, 2021): Configure multiple ubuntu images in `~/.actrc`. ``` -P ubuntu-latest=ghcr.io/catthehacker/ubuntu:full-latest -P ubuntu-18.04=ghcr.io/catthehacker/ubuntu:full-18.04 -P ubuntu-20.04=ghcr.io/catthehacker/ubuntu:full-20.04 ```
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#439
No description provided.