docker / build-push-action

GitHub Action to build and push Docker images with Buildx
https://github.com/marketplace/actions/build-and-push-docker-images
Apache License 2.0
4.13k stars 532 forks source link

buildx failed with: ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref #937

Closed jeankhawand closed 11 months ago

jeankhawand commented 11 months ago

Contributing guidelines

I've found a bug, and:

Description

I did follow multi platform build via this https://docs.docker.com/build/ci/github-actions/multi-platform/ unfortunately I was unable to proceed with this some steps are marked as ERROR which are usually COPY steps

Expected behaviour

continue executing each step

Actual behaviour

buildx failed with: ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref sskfjkf86ntslfbvad7pfphx5::rf06xaafkysvr9wmnmknn2uff: failed to walk /tmp/buildkit-mount3059587245/config: lstat /tmp/buildkit-mount3059587245/config: no such file or directory

Repository URL

https://github.com/jeankhawand/wazuh-docker

Workflow run URL

https://github.com/jeankhawand/wazuh-docker/blob/30f440c75c556b4df5f5fe51c768dde8c3d50f7e/.github/workflows/push.yml

YAML workflow

https://github.com/jeankhawand/wazuh-docker/blob/30f440c75c556b4df5f5fe51c768dde8c3d50f7e/.github/workflows/push.yml

Workflow logs

https://github.com/jeankhawand/wazuh-docker/actions/runs/5930142902/job/16079285528

BuildKit logs

https://github.com/jeankhawand/wazuh-docker/actions/runs/5930517043/job/16080397352

Additional info

jeankhawand commented 11 months ago

ref #934

crazy-max commented 11 months ago

Looking at the logs: https://github.com/jeankhawand/wazuh-docker/actions/runs/5930142902/job/16079285528#step:7:287

Dockerfile:49
--------------------
  47 |     # Sync calls are due to https://github.com/docker/docker/issues/9547
  48 |     
  49 | >>> COPY config/permanent_data.env config/permanent_data.sh /
  50 |     RUN chmod 755 /permanent_data.sh && \
  51 |         sync && /permanent_data.sh && \
--------------------

The error seems expected as there is no config/permanent_data.env file available in the context you've provided in: https://github.com/jeankhawand/wazuh-docker/blob/30f440c75c556b4df5f5fe51c768dde8c3d50f7e/.github/workflows/push.yml#L39

    - name: Build Wazuh manager docker image
      uses: docker/build-push-action@v4
      with:
        context: .
        file: ./build-docker-images/wazuh-manager/Dockerfile
        platforms: ${{ matrix.platform }}
        push: false
        buildkitd-flags: --debug
        outputs: type=tar,dest=/home/runner/work/wazuh-docker/wazuh-docker/docker-images/wazuh-manager.tar
        tags: |
          wazuh/wazuh-manager:${{env.WAZUH_IMAGE_VERSION}}

Which is the root of your repo: https://github.com/jeankhawand/wazuh-docker/tree/master

I guess you wanted to specify ./build-docker-images/wazuh-manager as context:

    - name: Build Wazuh manager docker image
      uses: docker/build-push-action@v4
      with:
        context: ./build-docker-images/wazuh-manager
        file: ./build-docker-images/wazuh-manager/Dockerfile
        platforms: ${{ matrix.platform }}
        push: false
        buildkitd-flags: --debug
        outputs: type=tar,dest=/home/runner/work/wazuh-docker/wazuh-docker/docker-images/wazuh-manager.tar
        tags: |
          wazuh/wazuh-manager:${{env.WAZUH_IMAGE_VERSION}}

Closing since that seems to be a misconfiguration of your workflow and not a bug of the action.