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

error: could not create a builder instance with TLS data loaded from environment #105

Closed
lexfrei opened this issue Aug 25, 2021 · 8 comments · Fixed by Tradeshift/actions-docker#312 or #341

Comments

@lexfrei
Copy link

lexfrei commented Aug 25, 2021

Behaviour

Steps to reproduce this issue

  1. Install k3s in your arm64 cluster
  2. Install actions-runner-controller
  3. Run your workflow there

Expected behaviour

No errors

Actual behaviour

error: could not create a builder instance with TLS data loaded from environment. Please use docker context create <context-name> to create a context for current environment and then create a builder instance with docker buildx create <context-name>

Configuration

name: Main Workflow

on:
  push

jobs:
  lint:
    runs-on: self-hosted
    steps:
      - uses: actions/[email protected]
      - name: golangci-lint
        uses: golangci/[email protected]
        with:
          version: v1.42
      # Waiting for https://github.com/hadolint/hadolint-action/issues/38
      # - name: hadolint
      #   uses: hadolint/[email protected]
      #   with:
      #     dockerfile: build/vk2tg/Dockerfile

  build:
    needs: lint
    runs-on: self-hosted
    steps:

    - name: Docker meta
      id: docker_meta
      uses: docker/[email protected]
      with:
        images: ghcr.io/${{ github.repository }}
        flavor: |
          latest=true
        tags: |
            type=ref,event=branch
            type=ref,event=pr
            type=sha
    - name: Set up QEMU
      uses: docker/[email protected]

    - name: Checkout
      uses: actions/[email protected]

    - name: Set up Docker Buildx
      uses: docker/[email protected]

  <...>

Logs

logs_415.zip

@crazy-max
Copy link
Member

crazy-max commented Sep 1, 2021

@lexfrei Looks like you're using a self-hosted runner and the default context is from a tls environment but you can't create a builder instance from a tls environment (see docker/buildx#30)

You have to create a context for the current environment with docker context create <context-name> like the error message suggest.

@lexfrei
Copy link
Author

lexfrei commented Sep 2, 2021

For history:
Fix

@DmitriyBobrovskiy
Copy link

For history: Fix

For the history if repo will be gone:
image

samip5 added a commit to skyssolutions/lynxchan that referenced this issue Nov 21, 2022
budimanjojo added a commit to budimanjojo/home-cluster that referenced this issue Jan 13, 2023
@joaoluiznaufel
Copy link

but this is coming back to version 1. Someome already know how to do a proper fix using v2?

@joaoluiznaufel
Copy link

ah, found it, you can use the v2 that it will continue work

@lifeofmoo
Copy link

lifeofmoo commented Apr 10, 2024

For history: Fix

For the history if repo will be gone: image

Hello, I used the findings above to resolve the issue for me.

#311

Is anyone able to comment/shed light as to WHY this works. Is this is an accepted approach or a workaround?

@crazy-max
Copy link
Member

crazy-max commented Jul 5, 2024

For history: Fix

Made some changes in #341 to automatically create a docker context if TLS data are loaded for default context if someone is willing to test on his self-hosted environment 🙏:

      -
        name: Set up Docker Buildx
        uses: crazy-max/docker-setup-buildx-action@docker-context-tls

@crazy-max
Copy link
Member

Should be fixed since 3.6.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants