8

I have been trying to build and push my Docker images through GitHub Actions and push them to my Docker Registry.

For this I have been using the following workflow file:

name: Docker publish

on:
  push:
    branches: [ develop ]

  workflow_dispatch:

jobs:

  build:

    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2

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

      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v1

      - name: Login to registry
        uses: docker/login-action@v1
        with:
          registry: https://registry.domain.com
          username: ${{ secrets.REGISTRY_USERNAME }}
          password: ${{ secrets.REGISTRY_PASSWORD }}

      - name: Build and push web
        id: docker_build_web
        uses: docker/build-push-action@v2
        with:
          push: true
          context: ./web
          tags: registry.domain.com/web:latest

      - name: Build and push api
        id: docker_build_api
        uses: docker/build-push-action@v2
        with:
          push: true
          context: ./api
          tags: registry.domain.com/api:latest

It all works well until it starts building the first image of the web project, which is an Angular project. After some time building the web image, it gives the error:

Error: buildx call failed with: error: failed to solve: rpc error: code = Unknown desc = failed to copy: unexpected status: 413 Request Entity Too Large

I have looked for quite a while now, but can not seem to find a fix for the problem or even the reason why this issue is happening. My only guess at the moment is that my images are too large.

Brum
  • 629
  • 7
  • 27

1 Answers1

0

For anyone looking for this, this has to do with registry nginx body limit.

As referenced here: Docker push error "413 Request Entity Too Large"

Tiago Mota
  • 46
  • 2
  • That link refers to configuring Docker Registry, not a GitHub Action build action. – Matthew Setter Mar 22 '23 at 16:00
  • @MatthewSetter The issue is related to reverse proxy configured before the self hosted registry OP is using to push the image in Github Action. `https://registry.domain.com` – Tiago Mota Mar 30 '23 at 15:19