Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Aisuko opened this issue Mar 25, 2021 · 12 comments
Closed

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

Aisuko opened this issue Mar 25, 2021 · 12 comments
Labels
area/cli Relating to the cli kind/feature-request New feature or request meta/workaround A workaround has been identified. stale

Comments

@Aisuko
Copy link

Aisuko commented Mar 25, 2021

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
@Aisuko Aisuko added the kind/bug Something isn't working label Mar 25, 2021
@Aisuko Aisuko changed the title Issue: Issue: Got error when use act at locally with remote docker contexts Mar 25, 2021
@catthehacker catthehacker added the needs-work Extra attention is needed label Apr 2, 2021
@github-actions

This comment has been minimized.

@github-actions github-actions bot added the stale label May 3, 2021
@Aisuko
Copy link
Author

Aisuko commented May 3, 2021

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

@ChristopherHX
Copy link
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

@github-actions github-actions bot removed the stale label May 4, 2021
@Aisuko
Copy link
Author

Aisuko commented 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.

@catthehacker catthehacker added area/cli Relating to the cli and removed kind/bug Something isn't working needs-work Extra attention is needed labels May 5, 2021
@catthehacker
Copy link
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.

@catthehacker catthehacker added meta/workaround A workaround has been identified. kind/feature-request New feature or request labels May 6, 2021
@davetapley
Copy link
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}}')

@Aisuko
Copy link
Author

Aisuko commented Jun 2, 2021

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

@Aisuko
Copy link
Author

Aisuko commented Jun 15, 2021

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

@github-actions

This comment has been minimized.

@github-actions github-actions bot added the stale label Jul 16, 2021
@Aisuko
Copy link
Author

Aisuko commented Jul 16, 2021

We can close this issue due to #749

@luckydonald
Copy link

Is this meant to be a workaround forever?

@buahaha
Copy link

buahaha commented 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 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli Relating to the cli kind/feature-request New feature or request meta/workaround A workaround has been identified. stale
Projects
None yet
Development

No branches or pull requests

6 participants