Git Product home page Git Product logo

Comments (8)

crazy-max avatar crazy-max commented on June 11, 2024 1

Seems also related to docker/buildx#756

from bake-action.

iwilltry42 avatar iwilltry42 commented on June 11, 2024

Hey @crazy-max or @justincormack , do you maybe have any idea on what could cause this? I'm pretty lost, since it seems to work locally, but not in GH Actions 🤔

from bake-action.

iwilltry42 avatar iwilltry42 commented on June 11, 2024

Ok, I realized that buildx bake does not work with multiple JSON files in addition to the HCL file, so I went ahead and added a step merging the JSON files and then I just use the merged output file in conjunction with the HCL file.

      - name: Merge Metadata Bake Definitions
        run: |
          INPUT=(${{ steps.meta-k3d-binary.outputs.bake-file }} ${{ steps.meta-k3d-dind.outputs.bake-file }} ${{ steps.meta-k3d-proxy.outputs.bake-file }} ${{ steps.meta-k3d-tools.outputs.bake-file }})
          OUT_FILE=./bake-metadata.json
          OUT_FILE_TMP=./bake-metadata-tmp.json

          cat << EOF > $OUT_FILE
          {
            "target": {}
          }
          EOF

          for file in "${INPUT[@]}"; do
            cat $OUT_FILE > $OUT_FILE_TMP
            jq -s '.[0] * .[1]' $OUT_FILE_TMP $file > $OUT_FILE
          done

          rm "$OUT_FILE_TMP"

from bake-action.

crazy-max avatar crazy-max commented on June 11, 2024

@iwilltry42 Sorry I completely missed your issue! I will take a look and try to repro on my side. Keep you in touch.

from bake-action.

iwilltry42 avatar iwilltry42 commented on June 11, 2024

No worries @crazy-max , it works with the workaround of merging the metadata json files first before passing them to the bake-action 👍
I also confirmed this with buildx CLI locally, so I guess it would have to go to the buildx repo in any case.

from bake-action.

crazy-max avatar crazy-max commented on June 11, 2024

@iwilltry42 I've made a small experiment with your use case and indeed there is an issue using the bake definition returned by the metadata action. Using an HCL definition works: https://github.com/crazy-max/buildx-buildkit-tests/tree/main/bake-action-61. Not sure if it's a limitation of the JSON definition or a wrong implementation of it. Keep you in touch.

from bake-action.

iwilltry42 avatar iwilltry42 commented on June 11, 2024

Ah that's interesting 🤔
If it'd be a limitation of using the JSON definition, it may be nice to have a switch for bake --print to output HCL instead of JSON (though I guess adding support for multiple JSON inputs probably ends up to be the same amount of effort in buildx).

Thank you for looking into this!

from bake-action.

iwilltry42 avatar iwilltry42 commented on June 11, 2024

Thanks for the fix guys! 🙏

from bake-action.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.