docker / setup-buildx-action

GitHub Action to set up Docker Buildx
https://github.com/marketplace/actions/docker-setup-buildx
Apache License 2.0
906 stars 142 forks source link

it does't not work with the github runner: macos-13-xlarge (silicon M1) #280

Closed timzaak closed 9 months ago

timzaak commented 9 months ago

Contributing guidelines

I've found a bug, and:

Description

The failed job is: https://github.com/ForNetCode/fornet/actions/runs/6408098883/job/17396329372

It works with mac x86_64, but failed with mac arm64.

This is the blog of github to release mac M1 runner: https://github.blog/2023-10-02-introducing-the-new-apple-silicon-powered-m1-macos-larger-runner-for-github-actions/. It might be the time to support M1.

Expected behaviour

works well with gitub macos-13-xlarge runner.

Actual behaviour

failed with the output:

ERROR: failed to initialize builder builder-717547df-7006-4cdd-b606-dbe91520f2d6 (builder-717547df-7006-4cdd-b606-dbe91520f2d60): Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

Repository URL

No response

Workflow run URL

No response

YAML workflow

name: fornet arm64 client build
on:
  workflow_dispatch:
    inputs:
      version:
        required: true
        description: "docker version to release"
env:
  REGISTRY: ghcr.io
jobs:
  docker-and-linux:
    runs-on: macos-13-xlarge
    steps:
      - uses: actions/checkout@v3
        with:
          submodules: true
      -
        name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v3
      -
        name: Login to GithubPackages
        uses: docker/login-action@v2
        with:
          registry: ${{ env.REGISTRY }}
          username: ${{ github.actor }}
          password: ${{ secrets.GITHUB_TOKEN }}
      -
        name: build and push docker image
        uses: docker/build-push-action@v2
        with:
          context: .
          #platforms: linux/amd64,linux/arm64
          push: true
          file: command/docker/client/client.Dockerfile
          cache-from: type=gha
          cache-to: type=gha,mode=max
          tags: ${{ env.REGISTRY }}/fornetcode/fornet:${{github.event.inputs.version}}
      - name: copy binary from docker to release directory
        run: |
          mkdir -p release 
          docker run --rm  -v ./release:/release ${{ env.REGISTRY }}/fornetcode/fornet:${{github.event.inputs.version}} cp /bin/fornet:/release/ && cp /bin/fornet-cli:/release
          cd release && tar  -czvf release/fornet-linux-aarch64.tar.gz ./fornet ./fornet-cli && rm fornet && rm fornet-cli
      - name: Upload artifact
        uses: actions/upload-artifact@v2
        with:
          name: fornet-linux-aarch64.tar.gz
          path: release/fornet-aarch64-unknown-linux-gnu.tar.gz
          if-no-files-found: error

Workflow logs

No response

BuildKit logs

No response

Additional info

No response

crazy-max commented 9 months ago

Docker is not available on macos runners. You can install it with this action: https://github.com/crazy-max/ghaction-setup-docker