[GH-ISSUE #850] Issue: act assumes bash shell when connecting to a container #516

Closed
opened 2026-03-01 21:44:05 +03:00 by kerem · 3 comments
Owner

Originally created by @till on GitHub (Oct 22, 2021).
Original GitHub issue: https://github.com/nektos/act/issues/850

Originally assigned to: @catthehacker on GitHub.

System information

- Operating System: macOS
- Architecture: x64 (64-bit)
- Apple M1: no
- Docker version: `20.10.8`
- `act` version: 0.2.24 (via brew)

Expected behaviour

  • ideally it would run my workflow, but start-up currently fails

Actual behaviour

  • act fails running my command
log output (without verbose) ``` ❯ act "pull_request" [test/deployment] 🚀 Start image=quay.io/pngmbh/quantum-cli:latest [test/deployment] 🐳 docker run image=quay.io/pngmbh/quantum-cli:latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] [test/deployment] 🐳 docker exec cmd=[mkdir -m 0777 -p /var/run/act] user=root [test/deployment] Run quantum-cli [test/deployment] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /dir/workflow/0] user= | OCI runtime exec failed: exec failed: container_linux.go:380: starting container process caused: exec: "bash": executable file not found in $PATH: unknown [test/deployment] Failure - quantum-cli Error: exit with `FAILURE`: 126 ```

The image is alpine-based, so there is no bash included by default.

A simple test of the image works though:

$ docker run quay.io/pngmbh/quantum-cli quantum-cli -h
...

Workflow and/or repository

runs quantum-cli --help
---
name: test

on:
  pull_request:

jobs:
  deployment:
    runs-on: ubuntu-latest
    container:
      image: quay.io/pngmbh/quantum-cli:latest
    steps:
      - name: quantum-cli
        run: >
          quantum-cli
          --help

Steps to reproduce

act "pull_request"

act output

Log (without env stuff)
...
[test/deployment] ⭐  Run quantum-cli
DEBU[0001] Wrote command '
quantum-cli --help

' to 'workflow/0' 
DEBU[0001] Writing entry to tarball workflow/0 len:19   
[test/deployment] Extracting content to '/dir'
[test/deployment]   🐳  docker exec cmd=[bash --noprofile --norc -e -o pipefail /Users/till/Documents/workspaces/pngmbh/pn-ci/workflow/0] user=
[test/deployment] Exec command '[bash --noprofile --norc -e -o pipefail /dir/workflow/0]'
| OCI runtime exec failed: exec failed: container_linux.go:380: starting container process caused: exec: "bash": executable file not found in $PATH: unknown
DEBU[0001] exit with `FAILURE`: 126                     
[test/deployment]   ❌  Failure - quantum-cli
DEBU[0001] exit with `FAILURE`: 126                     
Error: exit with `FAILURE`: 126
Originally created by @till on GitHub (Oct 22, 2021). Original GitHub issue: https://github.com/nektos/act/issues/850 Originally assigned to: @catthehacker on GitHub. ## System information - Operating System: macOS - Architecture: x64 (64-bit) - Apple M1: no - Docker version: `20.10.8` - `act` version: 0.2.24 (via brew) ## Expected behaviour - ideally it would run my workflow, but start-up currently fails ## Actual behaviour - act fails running my command <details> <summary>log output (without verbose)</summary> ``` ❯ act "pull_request" [test/deployment] 🚀 Start image=quay.io/pngmbh/quantum-cli:latest [test/deployment] 🐳 docker run image=quay.io/pngmbh/quantum-cli:latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[] [test/deployment] 🐳 docker exec cmd=[mkdir -m 0777 -p /var/run/act] user=root [test/deployment] ⭐ Run quantum-cli [test/deployment] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /dir/workflow/0] user= | OCI runtime exec failed: exec failed: container_linux.go:380: starting container process caused: exec: "bash": executable file not found in $PATH: unknown [test/deployment] ❌ Failure - quantum-cli Error: exit with `FAILURE`: 126 ``` </details> The image is alpine-based, so there is no `bash` included by default. A simple test of the image works though: ``` $ docker run quay.io/pngmbh/quantum-cli quantum-cli -h ... ``` ## Workflow and/or repository <details> <summary>runs quantum-cli --help</summary> ```yaml --- name: test on: pull_request: jobs: deployment: runs-on: ubuntu-latest container: image: quay.io/pngmbh/quantum-cli:latest steps: - name: quantum-cli run: > quantum-cli --help ``` </details> ## Steps to reproduce `act "pull_request"` ## `act` output <details> <summary>Log (without env stuff)</summary> ```none ... [test/deployment] ⭐ Run quantum-cli DEBU[0001] Wrote command ' quantum-cli --help ' to 'workflow/0' DEBU[0001] Writing entry to tarball workflow/0 len:19 [test/deployment] Extracting content to '/dir' [test/deployment] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /Users/till/Documents/workspaces/pngmbh/pn-ci/workflow/0] user= [test/deployment] Exec command '[bash --noprofile --norc -e -o pipefail /dir/workflow/0]' | OCI runtime exec failed: exec failed: container_linux.go:380: starting container process caused: exec: "bash": executable file not found in $PATH: unknown DEBU[0001] exit with `FAILURE`: 126 [test/deployment] ❌ Failure - quantum-cli DEBU[0001] exit with `FAILURE`: 126 Error: exit with `FAILURE`: 126 ``` </details>
Author
Owner

@till commented on GitHub (Oct 22, 2021):

As a follow-up, the crash seems "so hard", that containers stay running. Let me know if you'd like another ticket.

<!-- gh-comment-id:949428410 --> @till commented on GitHub (Oct 22, 2021): As a follow-up, the crash seems "so hard", that containers stay running. Let me know if you'd like another ticket.
Author
Owner

@buddyjansen8 commented on GitHub (Oct 25, 2021):

Add the default shell executor to the job:

  defaults:
      run:
        shell: sh
<!-- gh-comment-id:950676864 --> @buddyjansen8 commented on GitHub (Oct 25, 2021): Add the default shell executor to the job: ``` defaults: run: shell: sh ```
Author
Owner

@till commented on GitHub (Oct 30, 2021):

Thank you, that works!

<!-- gh-comment-id:955160888 --> @till commented on GitHub (Oct 30, 2021): Thank you, that works!
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#516
No description provided.