ERROR: Error on COPY command when using caching "failed to solve: failed to compute cache key"
I am using the gha caching for my github workflow, more often now I'm getting the following error:
ERROR: failed to solve: failed to compute cache key: failed to copy: read tcp 1.1.1.148464->2.2.2.2:443: read: connection timed out
When this error occurs one or two reruns will make it work, lately It becomes more frequent and interfering with our work, wanted to know if others encountered this and if this is something in my configuration that I can adjust or is it a bug.
configuration:
- name: build image
uses: docker/build-push-action@v4
with:
push: true
context: ./${{ inputs.image_path }}
provenance: false
tags: |
${{ inputs.docker_repo }}/${{ env.NAME }}:${{ env.TAG }}
build-args: |
GIT_BRANCH=${{ inputs.branch }}
GIT_REPO=${{ github.repository }}
GIT_TAG=${{ env.TAG }}
target: ${{ inputs.target }}
file: ./${{ inputs.image_path }}/${{ inputs.dockerfile_name }}
cache-from: type=gha
cache-to: type=gha,mode=max
Observed the same with both inline and registry cache, for the ADD command with src=<URL>. Made me go back to docker builder, which is sad since that one sucks at multi-stage builds due the lack of registry cache
Without a reproducible (even if multiple attempts are needed) testcase it is hard to say if this is just a network stack issue or something in the builder.
I'll try to reproduce it next time this happens