Skip to content

Issue: Got error when use act at locally with remote docker contexts #583

Closed

Description

@Aisuko

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

Activity

  1. changed the title [-]Issue: [/-] [+]Issue: Got error when use act at locally with remote docker contexts[/+] on Mar 25, 2021
  2. github-actions commented on May 3, 2021

    @github-actions
  3. Aisuko commented on May 3, 2021

    @Aisuko
    Author

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

  4. ChristopherHX commented on May 3, 2021

    @ChristopherHX
    Contributor

    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

  5. Aisuko commented on May 5, 2021

    @Aisuko
    Author

    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.

  6. added
    area/cliRelating to the cli
    and removed
    kind/bugSomething isn't working
    needs-workExtra attention is needed
    on May 5, 2021
  7. catthehacker commented on May 5, 2021

    @catthehacker
    Member

    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.

  8. davetapley commented on Jun 1, 2021

    @davetapley
    Contributor

    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}}')
  9. Aisuko commented on Jun 2, 2021

    @Aisuko
    Author

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

  10. Aisuko commented on Jun 15, 2021

    @Aisuko
    Author

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

  11. github-actions commented on Jul 16, 2021

    @github-actions
  12. Aisuko commented on Jul 16, 2021

    @Aisuko
    Author

    We can close this issue due to #749

  13. luckydonald commented on Jan 29, 2024

    @luckydonald

    Is this meant to be a workaround forever?

  14. buahaha commented on Aug 17, 2024

    @buahaha

    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 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions