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: container-tools/[email protected] (registry:true) not working #782

Closed
kanedafromparis opened this issue Aug 20, 2021 · 6 comments
Closed
Labels
kind/bug Something isn't working stale

Comments

@kanedafromparis
Copy link

System information

- Operating System: macOS 
- Architecture: x64 (64-bit) 
- Apple M1: no
- Docker version: 20.10.6
- Docker image used in `act`: catthehacker/ubuntu:act-latest (digests sha256:26199cb25652c2f8a373cd5891fc9fee75f3f509d0667f35e7eabdc5e0be7713)
- `act` version: act version 0.2.24

Expected behaviour

Actual behaviour

this action :

        - name: Create Kubernetes KinD Cluster (ACT)
          uses: container-tools/[email protected]
          with:
            cluster_name: tomcat-local-apply
            registry: true

works in github action but not locally.

Workflow and/or repository

I set a sample repository : https://github.com/kanedafromparis/act-issue-with-kind-registry/

Steps to reproduce

just run act

act output

Log
[Sample integration test/kind_integration_test]   🐳  docker exec cmd=[node /var/run/act/actions/[email protected]/main.js] user=
| Creating registry "kind-registry" on port 5000 from image "registry:2"...
| 127.0.0.1 kind-registry
| jq: error: Could not open file /etc/docker/daemon.json: No such file or directory
| docker: unrecognized service
@kanedafromparis kanedafromparis added the kind/bug Something isn't working label Aug 20, 2021
@johnpoth
Copy link

Ran into the same issue. That being said, it might be tricky to restart docker within docker ...

@catthehacker
Copy link
Member

This should be possible with live-restore option but it would require user to configure it first or run act as root (sudo/doas/su)

@johnpoth
Copy link

The script that's being run is trying to restart docker via sudo service docker restart inside act's docker container catthehacker/ubuntu:act-20.04, which doesn't exist hence the error.
It's trying to restart Docker because it added an insecure registry to /etc/docker/deamon.json (the file doesn't even exists in act's docker container).
This is all because this action it thinks it's on the root machine and not in a docker container

@kanedafromparis
Copy link
Author

kanedafromparis commented Sep 16, 2021

Hi, thank for your feed back.

I did found a way around using registry: false and kind load image-archive

WDYT ?

@johnpoth
Copy link

yeah me too then in a step just before the kind-action something like:

    - name: Configure docker registry
      if: ${{ env.ACT }}
      run: |
        sudo mkdir -p /etc/kind-registry
        cat <<EOF | sudo dd status=none of=/etc/kind-registry/config.yaml
        kind: Cluster
        apiVersion: kind.x-k8s.io/v1alpha4
        containerdConfigPatches:
        - |-
          [plugins."io.containerd.grpc.v1.cri".registry.mirrors."${KIND_REGISTRY}"]
            endpoint = ["http://${KIND_REGISTRY}"]
        EOF
        sudo chmod a+r /etc/kind-registry/config.yaml

and after something like

    - name: Configure docker registry
      if: ${{ env.ACT }}
      run: |
        cat <<EOF | kubectl apply -f -
        apiVersion: v1
        kind: ConfigMap
        metadata:
          name: local-registry-hosting
          namespace: kube-public
        data:
          localRegistryHosting.v1: |
            host: "${KIND_REGISTRY}"
            help: "https://kind.sigs.k8s.io/docs/user/local-registry/"
        EOF

So that the kind cluster is setup to use your local registry.

@github-actions
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working stale
Projects
None yet
Development

No branches or pull requests

3 participants