[GH-ISSUE #583] Issue: Got error when use act at locally with remote docker contexts #388

Closed
opened 2026-03-01 21:42:56 +03:00 by kerem · 12 comments
Owner

Originally created by @Aisuko on GitHub (Mar 25, 2021).
Original GitHub issue: https://github.com/nektos/act/issues/583

Act version

➜  helm-charts-action git:(master) ✗ act --version
act version 0.2.20

Expected behaviour

act can work well with remote docker context, and I can pull the target image by manually.

Actual behaviour

act can not pull the image

Workflow and/or repository

workflow
name: Release Charts

on:
  push:
    branches:
      - master
  workflow_dispatch:
    inputs:
      logLevel:
        description: 'Log level'
        required: true
        default: 'warning'

jobs:
  release:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
        with:
          fetch-depth: 0

      - name: Configure Git
        run: |
          git config user.name "$GITHUB_ACTOR"
          git config user.email "$GITHUB_ACTOR@users.noreply.github.com"

      - name: Install Helm
        uses: azure/setup-helm@v1
        with:
          version: v3.4.1

      # Optional step if GPG signing is used
      # - name: Prepare GPG key
      #   run: |
      #     gpg_dir=.cr-gpg
      #     mkdir "$gpg_dir"

      #     keyring="$gpg_dir/secring.gpg"
      #     base64 -d <<< "$GPG_KEYRING_BASE64" > "$keyring"

      #     passphrase_file="$gpg_dir/passphrase"
      #     echo "$GPG_PASSPHRASE" > "$passphrase_file"

      #     echo "CR_PASSPHRASE_FILE=$passphrase_file" >> "$GITHUB_ENV"
      #     echo "CR_KEYRING=$keyring" >> "$GITHUB_ENV"
      #   env:
      #     GPG_KEYRING_BASE64: "${{ secrets.GPG_KEYRING_BASE64 }}"
      #     GPG_PASSPHRASE: "${{ secrets.GPG_PASSPHRASE }}"

      - name: Add dependency chart repos
        run: |
          helm repo add meshery https://meshery.io/charts/

      - name: Helm Chart Releaser For Remote
        uses: Aisuko/chart-releaser-action@v1.0.0-alpha.4
        with:
          charts_dir: install
          owner: Aisuko
          repo: charts-release
          # For helm charts index
          charts_repo_url: https://aisuko.github.io/charts-release
        env:
          CR_TOKEN: "${{ secrets.TOKEN }}"

Steps to reproduce

act output

Log
➜  helm-charts-action git:(master) ✗ act -n -v
DEBU[0000] Loading environment from /Users/peasant/Documents/helm-charts-action/.env
DEBU[0000] Loading secrets from /Users/peasant/Documents/helm-charts-action/.secrets
DEBU[0000] Loading workflows from '/Users/peasant/Documents/helm-charts-action/.github/workflows'
DEBU[0000] Reading workflow '/Users/peasant/Documents/helm-charts-action/.github/workflows/lint-test.yaml'
DEBU[0000] Reading workflow '/Users/peasant/Documents/helm-charts-action/.github/workflows/release.yaml'
DEBU[0000] Planning event: push
DEBU[0000] Loading slug from git directory '/Users/peasant/Documents/helm-charts-action/.git'
DEBU[0000] Found revision: 296c8e291f2da06b236c92629848fd4663bd3a9e
DEBU[0000] Loading revision from git directory '/Users/peasant/Documents/helm-charts-action/.git'
DEBU[0000] Found revision: 296c8e291f2da06b236c92629848fd4663bd3a9e
DEBU[0000] HEAD points to '296c8e291f2da06b236c92629848fd4663bd3a9e'
DEBU[0000] HEAD matches refs/heads/master
DEBU[0000] using github ref: refs/heads/master
DEBU[0000] context env => map[ACT:true CR_TOKEN:12c8f8fe2e21bd57107357fd0d5b5da665a9711b]
DEBU[0000] Loading slug from git directory '/Users/peasant/Documents/helm-charts-action/.git'
DEBU[0000] Found revision: 296c8e291f2da06b236c92629848fd4663bd3a9e
DEBU[0000] Loading revision from git directory '/Users/peasant/Documents/helm-charts-action/.git'
DEBU[0000] Found revision: 296c8e291f2da06b236c92629848fd4663bd3a9e
DEBU[0000] HEAD points to '296c8e291f2da06b236c92629848fd4663bd3a9e'
DEBU[0000] HEAD matches refs/heads/master
DEBU[0000] using github ref: refs/heads/master
DEBU[0000] context env => map[ACT:true CR_TOKEN:12c8f8fe2e21bd57107357fd0d5b5da665a9711b]
*DRYRUN* [Release Charts/release        ] 🚀  Start image=catthehacker/ubuntu:act-latest
DEBU[0000] Loading slug from git directory '/Users/peasant/Documents/helm-charts-action/.git'
DEBU[0000] Found revision: 296c8e291f2da06b236c92629848fd4663bd3a9e
DEBU[0000] Loading revision from git directory '/Users/peasant/Documents/helm-charts-action/.git'
DEBU[0000] Found revision: 296c8e291f2da06b236c92629848fd4663bd3a9e
DEBU[0000] HEAD points to '296c8e291f2da06b236c92629848fd4663bd3a9e'
DEBU[0000] HEAD matches refs/heads/master
DEBU[0000] using github ref: refs/heads/master
*DRYRUN* [Release Charts/release        ]   🐳  docker pull catthehacker/ubuntu:act-latest
*DRYRUN* [Lint and Test Charts/lint-test] 🚀  Start image=catthehacker/ubuntu:act-latest
DEBU[0000] Loading slug from git directory '/Users/peasant/Documents/helm-charts-action/.git'
DEBU[0000] Found revision: 296c8e291f2da06b236c92629848fd4663bd3a9e
DEBU[0000] Loading revision from git directory '/Users/peasant/Documents/helm-charts-action/.git'
DEBU[0000] Found revision: 296c8e291f2da06b236c92629848fd4663bd3a9e
DEBU[0000] HEAD points to '296c8e291f2da06b236c92629848fd4663bd3a9e'
DEBU[0000] HEAD matches refs/heads/master
DEBU[0000] using github ref: refs/heads/master
*DRYRUN* [Lint and Test Charts/lint-test]   🐳  docker pull catthehacker/ubuntu:act-latest
DEBU[0000] FIXME: Got an status-code for which error does not match any expected type!!!: -1  module=api status_code=-1
DEBU[0000] Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
DEBU[0000] Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
DEBU[0000] Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
DEBU[0000] Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
DEBU[0000] Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
DEBU[0000] FIXME: Got an status-code for which error does not match any expected type!!!: -1  module=api status_code=-1
DEBU[0000] Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
DEBU[0000] Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
DEBU[0000] Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
DEBU[0000] Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
DEBU[0000] Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
Error: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
➜  helm-charts-action git:(master) ✗ docker context ls
NAME            DESCRIPTION                               DOCKER ENDPOINT               KUBERNETES ENDPOINT   ORCHESTRATOR
default         Current DOCKER_HOST based configuration   unix:///var/run/docker.sock                         swarm
redthirteen *   redthirteen                               ssh://aisuko@192.168.1.104
➜  helm-charts-action git:(master) ✗ docker images
REPOSITORY                                                      TAG                                        IMAGE ID       CREATED         SIZE
catthehacker/ubuntu                                             act-latest                                 516a91a01868   2 days ago      528MB
sickcodes/docker-osx                                            big-sur                                    a32a578a260a   5 days ago      3.25GB
<none>                                                          <none>                                     c14679285dd2   9 days ago      815MB
<none>                                                          <none>                                     d6b4fd464b03   9 days ago      815MB
vsc-mit-scheme-a3ad0cd28c253fbef4b418939bae5d95-uid             latest                                     5836980029e7   2 weeks ago     711MB
vsc-mit-scheme-a3ad0cd28c253fbef4b418939bae5d95                 latest                                     692f54af05cc   2 weeks ago     711MB
<none>                                                          <none>                                     261c7901ecab   4 weeks ago     711MB
vsc-mit-gnu-scheme-f8156c18abdddf4975e24318610814dd             latest                                     b45be34c65db   4 weeks ago     711MB
Originally created by @Aisuko on GitHub (Mar 25, 2021). Original GitHub issue: https://github.com/nektos/act/issues/583 <!-- - 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` --> ```none ➜ helm-charts-action git:(master) ✗ act --version act version 0.2.20 ``` ## Expected behaviour <!-- Describe how whole process should go and finish --> `act` can work well with remote docker context, and I can pull the target image by manually. ## Actual behaviour `act` can not pull the image <!-- Describe what happened --> ## Workflow and/or repository <details> <summary>workflow</summary> ```none name: Release Charts on: push: branches: - master workflow_dispatch: inputs: logLevel: description: 'Log level' required: true default: 'warning' jobs: release: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v2 with: fetch-depth: 0 - name: Configure Git run: | git config user.name "$GITHUB_ACTOR" git config user.email "$GITHUB_ACTOR@users.noreply.github.com" - name: Install Helm uses: azure/setup-helm@v1 with: version: v3.4.1 # Optional step if GPG signing is used # - name: Prepare GPG key # run: | # gpg_dir=.cr-gpg # mkdir "$gpg_dir" # keyring="$gpg_dir/secring.gpg" # base64 -d <<< "$GPG_KEYRING_BASE64" > "$keyring" # passphrase_file="$gpg_dir/passphrase" # echo "$GPG_PASSPHRASE" > "$passphrase_file" # echo "CR_PASSPHRASE_FILE=$passphrase_file" >> "$GITHUB_ENV" # echo "CR_KEYRING=$keyring" >> "$GITHUB_ENV" # env: # GPG_KEYRING_BASE64: "${{ secrets.GPG_KEYRING_BASE64 }}" # GPG_PASSPHRASE: "${{ secrets.GPG_PASSPHRASE }}" - name: Add dependency chart repos run: | helm repo add meshery https://meshery.io/charts/ - name: Helm Chart Releaser For Remote uses: Aisuko/chart-releaser-action@v1.0.0-alpha.4 with: charts_dir: install owner: Aisuko repo: charts-release # For helm charts index charts_repo_url: https://aisuko.github.io/charts-release env: CR_TOKEN: "${{ secrets.TOKEN }}" ``` </details> ## Steps to reproduce <!-- Make sure to include command you used to run `act` e.g.: 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 <!-- Paste output from your terminal, use `-v` or `--verbose` for richer output --> <details> <summary>Log</summary> ```none ➜ helm-charts-action git:(master) ✗ act -n -v DEBU[0000] Loading environment from /Users/peasant/Documents/helm-charts-action/.env DEBU[0000] Loading secrets from /Users/peasant/Documents/helm-charts-action/.secrets DEBU[0000] Loading workflows from '/Users/peasant/Documents/helm-charts-action/.github/workflows' DEBU[0000] Reading workflow '/Users/peasant/Documents/helm-charts-action/.github/workflows/lint-test.yaml' DEBU[0000] Reading workflow '/Users/peasant/Documents/helm-charts-action/.github/workflows/release.yaml' DEBU[0000] Planning event: push DEBU[0000] Loading slug from git directory '/Users/peasant/Documents/helm-charts-action/.git' DEBU[0000] Found revision: 296c8e291f2da06b236c92629848fd4663bd3a9e DEBU[0000] Loading revision from git directory '/Users/peasant/Documents/helm-charts-action/.git' DEBU[0000] Found revision: 296c8e291f2da06b236c92629848fd4663bd3a9e DEBU[0000] HEAD points to '296c8e291f2da06b236c92629848fd4663bd3a9e' DEBU[0000] HEAD matches refs/heads/master DEBU[0000] using github ref: refs/heads/master DEBU[0000] context env => map[ACT:true CR_TOKEN:12c8f8fe2e21bd57107357fd0d5b5da665a9711b] DEBU[0000] Loading slug from git directory '/Users/peasant/Documents/helm-charts-action/.git' DEBU[0000] Found revision: 296c8e291f2da06b236c92629848fd4663bd3a9e DEBU[0000] Loading revision from git directory '/Users/peasant/Documents/helm-charts-action/.git' DEBU[0000] Found revision: 296c8e291f2da06b236c92629848fd4663bd3a9e DEBU[0000] HEAD points to '296c8e291f2da06b236c92629848fd4663bd3a9e' DEBU[0000] HEAD matches refs/heads/master DEBU[0000] using github ref: refs/heads/master DEBU[0000] context env => map[ACT:true CR_TOKEN:12c8f8fe2e21bd57107357fd0d5b5da665a9711b] *DRYRUN* [Release Charts/release ] 🚀 Start image=catthehacker/ubuntu:act-latest DEBU[0000] Loading slug from git directory '/Users/peasant/Documents/helm-charts-action/.git' DEBU[0000] Found revision: 296c8e291f2da06b236c92629848fd4663bd3a9e DEBU[0000] Loading revision from git directory '/Users/peasant/Documents/helm-charts-action/.git' DEBU[0000] Found revision: 296c8e291f2da06b236c92629848fd4663bd3a9e DEBU[0000] HEAD points to '296c8e291f2da06b236c92629848fd4663bd3a9e' DEBU[0000] HEAD matches refs/heads/master DEBU[0000] using github ref: refs/heads/master *DRYRUN* [Release Charts/release ] 🐳 docker pull catthehacker/ubuntu:act-latest *DRYRUN* [Lint and Test Charts/lint-test] 🚀 Start image=catthehacker/ubuntu:act-latest DEBU[0000] Loading slug from git directory '/Users/peasant/Documents/helm-charts-action/.git' DEBU[0000] Found revision: 296c8e291f2da06b236c92629848fd4663bd3a9e DEBU[0000] Loading revision from git directory '/Users/peasant/Documents/helm-charts-action/.git' DEBU[0000] Found revision: 296c8e291f2da06b236c92629848fd4663bd3a9e DEBU[0000] HEAD points to '296c8e291f2da06b236c92629848fd4663bd3a9e' DEBU[0000] HEAD matches refs/heads/master DEBU[0000] using github ref: refs/heads/master *DRYRUN* [Lint and Test Charts/lint-test] 🐳 docker pull catthehacker/ubuntu:act-latest DEBU[0000] FIXME: Got an status-code for which error does not match any expected type!!!: -1 module=api status_code=-1 DEBU[0000] Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? DEBU[0000] Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? DEBU[0000] Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? DEBU[0000] Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? DEBU[0000] Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? DEBU[0000] FIXME: Got an status-code for which error does not match any expected type!!!: -1 module=api status_code=-1 DEBU[0000] Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? DEBU[0000] Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? DEBU[0000] Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? DEBU[0000] Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? DEBU[0000] Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? Error: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? ➜ helm-charts-action git:(master) ✗ docker context ls NAME DESCRIPTION DOCKER ENDPOINT KUBERNETES ENDPOINT ORCHESTRATOR default Current DOCKER_HOST based configuration unix:///var/run/docker.sock swarm redthirteen * redthirteen ssh://aisuko@192.168.1.104 ➜ helm-charts-action git:(master) ✗ docker images REPOSITORY TAG IMAGE ID CREATED SIZE catthehacker/ubuntu act-latest 516a91a01868 2 days ago 528MB sickcodes/docker-osx big-sur a32a578a260a 5 days ago 3.25GB <none> <none> c14679285dd2 9 days ago 815MB <none> <none> d6b4fd464b03 9 days ago 815MB vsc-mit-scheme-a3ad0cd28c253fbef4b418939bae5d95-uid latest 5836980029e7 2 weeks ago 711MB vsc-mit-scheme-a3ad0cd28c253fbef4b418939bae5d95 latest 692f54af05cc 2 weeks ago 711MB <none> <none> 261c7901ecab 4 weeks ago 711MB vsc-mit-gnu-scheme-f8156c18abdddf4975e24318610814dd latest b45be34c65db 4 weeks ago 711MB ``` </details>
Author
Owner

@github-actions[bot] commented on GitHub (May 3, 2021):

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

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

@Aisuko commented on GitHub (May 3, 2021):

@catthehacker I can help test or contribution, please do some feedback

<!-- gh-comment-id:830988346 --> @Aisuko commented on GitHub (May 3, 2021): @catthehacker I can help test or contribution, please do some feedback
Author
Owner

@ChristopherHX commented on GitHub (May 3, 2021):

I think act doesn't read docker context configurations, no idea how to do that.

I would try to set the environment variable DOCKER_HOST=ssh://aisuko@192.168.1.104, then act should be able to connect.

DOCKER_HOST=ssh://aisuko@192.168.1.104 act

In the log it tried to connect to localhost, because DOCKER_HOST was set to it's default (or unset) unix:///var/run/docker.sock

<!-- gh-comment-id:831554193 --> @ChristopherHX commented on GitHub (May 3, 2021): I think act doesn't read docker context configurations, no idea how to do that. I would try to set the environment variable `DOCKER_HOST=ssh://aisuko@192.168.1.104`, then act should be able to connect. ```bash DOCKER_HOST=ssh://aisuko@192.168.1.104 act ``` In the log it tried to connect to localhost, because `DOCKER_HOST` was set to it's default (or unset) `unix:///var/run/docker.sock`
Author
Owner

@Aisuko commented on GitHub (May 5, 2021):

I think act doesn't read docker context configurations, no idea how to do that.

I would try to set the environment variable DOCKER_HOST=ssh://aisuko@192.168.1.104, then act should be able to connect.

DOCKER_HOST=ssh://aisuko@192.168.1.104 act

In the log it tried to connect to localhost, because DOCKER_HOST was set to it's default (or unset) unix:///var/run/docker.sock

Thanks, I will take it a try.

<!-- gh-comment-id:832573639 --> @Aisuko commented on GitHub (May 5, 2021): > I think act doesn't read docker context configurations, no idea how to do that. > > I would try to set the environment variable `DOCKER_HOST=ssh://aisuko@192.168.1.104`, then act should be able to connect. > > ```shell > DOCKER_HOST=ssh://aisuko@192.168.1.104 act > ``` > > In the log it tried to connect to localhost, because `DOCKER_HOST` was set to it's default (or unset) `unix:///var/run/docker.sock` Thanks, I will take it a try.
Author
Owner

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

Docker contexts are not supported and it's quite easy to overcome that (example above). Anyone can feel free to make PR with such feature but it won't be actively pursued.

<!-- gh-comment-id:832924775 --> @catthehacker commented on GitHub (May 5, 2021): Docker contexts are not supported and it's quite easy to overcome that (example above). Anyone can feel free to make PR with such feature but it won't be actively pursued.
Author
Owner

@davetapley commented on GitHub (Jun 1, 2021):

Here are one liners to set DOCKER_HOST automatically from current context:

bash:

export DOCKER_HOST=$(docker context inspect --format '{{.Endpoints.docker.Host}}')

pwsh:

$env:DOCKER_HOST = (docker context inspect --format '{{.Endpoints.docker.Host}}')
<!-- gh-comment-id:852285247 --> @davetapley commented on GitHub (Jun 1, 2021): Here are one liners to set `DOCKER_HOST` automatically from current `context`: `bash`: ```bash export DOCKER_HOST=$(docker context inspect --format '{{.Endpoints.docker.Host}}') ``` `pwsh`: ```pwsh $env:DOCKER_HOST = (docker context inspect --format '{{.Endpoints.docker.Host}}') ```
Author
Owner

@Aisuko commented on GitHub (Jun 2, 2021):

I believe we can add these to the README.md as tips, simpler for using is enough.

<!-- gh-comment-id:852631967 --> @Aisuko commented on GitHub (Jun 2, 2021): I believe we can add these to the `README.md` as tips, simpler for using is enough.
Author
Owner

@Aisuko commented on GitHub (Jun 15, 2021):

In fact, I'd like to add these to the .env file.

<!-- gh-comment-id:861110302 --> @Aisuko commented on GitHub (Jun 15, 2021): In fact, I'd like to add these to the `.env` file.
Author
Owner

@github-actions[bot] commented on GitHub (Jul 16, 2021):

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

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

@Aisuko commented on GitHub (Jul 16, 2021):

We can close this issue due to #749

<!-- gh-comment-id:881121022 --> @Aisuko commented on GitHub (Jul 16, 2021): We can close this issue due to #749
Author
Owner

@luckydonald commented on GitHub (Jan 29, 2024):

Is this meant to be a workaround forever?

<!-- gh-comment-id:1913778526 --> @luckydonald commented on GitHub (Jan 29, 2024): Is this meant to be a workaround forever?
Author
Owner

@buahaha commented on GitHub (Aug 17, 2024):

Using podman installed with Homebrew on macOS you can simply follow the instructions during:

podman machine start // this will show the optional helper installation command
podman machine stop
sudo /opt/homebrew/Cellar/podman/5.1.2/bin/podman-mac-helper install

Now you can use it like it's Docker with act 🚀

<!-- gh-comment-id:2294598524 --> @buahaha commented on GitHub (Aug 17, 2024): Using `podman` installed with __Homebrew__ on _macOS_ you can simply follow the instructions during: ```sh podman machine start // this will show the optional helper installation command podman machine stop sudo /opt/homebrew/Cellar/podman/5.1.2/bin/podman-mac-helper install ``` Now you can use it like it's `Docker` with `act` 🚀
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#388
No description provided.