Behaviour
Steps to reproduce this issue
- Create a
Dockerfile which will result in at least 1 big layer (e.g. RUN npm install with lots of deps)
- Use Github Actions w/ shared runners to build such Dockerfile using:
docker/setup-buildx-action@v1 and docker/build-push-action@v2
Expected behaviour
Successfully published docker image && layers to ghcr.io and job finishes.
Actual behaviour
Publishing layer results in a error: failed to copy: failed to do request and the job got stuck.
E.g.:
error: failed to copy: failed to do request: Put "https://ghcr.io/v2/deradon/reproduce-gh-buildx-issue/blobs/upload/71fa65fd-f252-4e55-9d68-682c3f8bb02f?digest=sha256%3Af09067957a188c44413d7495878dcb63467764e2f271028891385b9a7482d3a7": write tcp 172.17.0.2:42616->140.82.112.33:443: write: connection reset by peer
NOTE
Not using docker/setup-buildx-action@v1 will result in successful publishing.
Configuration
# .github/workflow/ci.yml
name: CI
on: [push]
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
DOCKER_BUILDKIT: 1
COMPOSE_DOCKER_CLI_BUILD: 1
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
build-and-upload-docker-image:
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
packages: write
outputs:
docker-tag: ${{ steps.meta.outputs.tags }}
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
with:
buildkitd-flags: --debug
- name: Log in to the Container registry
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
file: Dockerfile
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: |
type=registry,ref=${{ steps.meta.outputs.tags }}
type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:main
cache-to: type=inline
Logs
Behaviour
Steps to reproduce this issue
Dockerfilewhich will result in at least 1 big layer (e.g.RUN npm installwith lots of deps)docker/setup-buildx-action@v1anddocker/build-push-action@v2Expected behaviour
Actual behaviour
E.g.:
NOTE
Not using
docker/setup-buildx-action@v1will result in successful publishing.Configuration
Logs