Skip to content

Support cache tonistiigi/binfmt docker images #166

Closed

Description

@seepine

Description

I use gitea actions of self runner, it pull tonistiigi/binfmt:latest every times.
My network environment is not very good, sometimes pulling Docker images will time out.
So it maybe resolve my problem that if setup-qemu-action can cache pull docker image.

::endgroup::
::group::Pulling binfmt Docker image
[command]/usr/bin/docker pull tonistiigi/binfmt:latest
Error response from daemon: Head "https://registry-1.docker.io/v2/tonistiigi/binfmt/manifests/latest": dial tcp: lookup registry-1.docker.io on 127.0.0.53:53: read udp 127.0.0.1:37372->127.0.0.53:53: i/o timeout
::endgroup::
::error::The process '/usr/bin/docker' failed with exit code 1

My workflow yml

      - name: Set up QEMU
        uses: docker/setup-qemu-action@v2

      - name: Set up Docker BuildX
        uses: docker/setup-buildx-action@v2

      - name: Login to DockerHub
        uses: docker/login-action@v2
        with:
          registry: ${{ env.DOCKER_REGISTRY }}
          username: ${{ env.DOCKER_USERNAME }}
          password: ${{ secrets.DOCKER_PASSWORD }}

      - name: Cache docker build
        uses: actions/cache@v3
        with:
          path: /opt/docker-cache/.build-cache
          key: ${{ runner.os }}-${{ steps.meta.outputs.REPO_NAME }}-docker-build-cache

      - name: Build and push
        uses: docker/build-push-action@v4
        with:
          context: .
          file: ./docker/Dockerfile
          platforms: |
            linux/amd64
            linux/arm64
          push: true
          tags: |
            ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_USERNAME }}/${{ env.REPO_NAME }}:latest
            ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_USERNAME }}/${{ env.REPO_NAME }}:${{ env.REPO_VERSION }}
          cache-from: type=local,src=/opt/docker-cache/.build-cache
          cache-to: type=local,dest=/opt/docker-cache/.build-cache,mode=max

Activity

  1. mark24slides commented on Oct 15, 2024

    @mark24slides

    Binfmt issue also happened to me, but due to many requests.

    Pulling binfmt Docker image
    /usr/local/bin/docker pull docker.io/tonistiigi/binfmt:latest
    Error response from daemon: toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit

    Is it possible to add cache, or usage of own/diff binfmt

  2. lukehsiao commented on Nov 12, 2024

    @lukehsiao

    Image

    We are seeing the same.

  3. gregkonush commented on Nov 30, 2024

    @gregkonush

    did anyone find a workaround? I am getting too many requests and I don't know how to login to docker increase the limit or point it to an image in registry as well

  4. smoke commented on Dec 1, 2024

    @smoke

    did anyone find a workaround? I am getting too many requests and I don't know how to login to docker increase the limit or point it to an image in registry as well

    Yes, find and use pull-through cache for example AWS has such cache and I am using it like that.

        - name: Set up QEMU
          uses: docker/setup-qemu-action@v3
          with:
            # switch to AWS public ECR mirror
            image: 'public.ecr.aws/eks-distro-build-tooling/binfmt-misc:qemu-v7.0.0'
    
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