Giter Club home page Giter Club logo

Comments (4)

ericzzzzzzz avatar ericzzzzzzz commented on June 17, 2024 1

Hi @aizam6066 , by default skaffold uses golang docker sdk to talk to docker daemon unless users specify under local build environment to use docker cli, user want to use buildKit, or skaffold needs to perform crossplatform build. 

this doc https://docs.docker.com/build/guide/multi-platform/#platform-build-arguments mentions that 

This approach involves using a few pre-defined build arguments that you have access to in your Docker builds: BUILDPLATFORM and TARGETPLATFORM (and derivatives, like TARGETOS). These build arguments reflect the values you pass to the --platform flag this seems to suggest that it only works when you use docker cli for your build 

You need to add 

 local:
  useDockerCLI: true

under the build stanza to make your build work. 

from skaffold.

ericzzzzzzz avatar ericzzzzzzz commented on June 17, 2024 1

Hi @aizam6066 ,
Why do you think it started breaking now after a year or so of us not having this key in our skaffold.yaml. The only thing I can think of is GH runners install the latest skaffold version and somewhere in the later version updates, this started to break?
This is related to the change I made on #9103 to enable docker build without docker cli, and the comment on that part also indicates that matcher.IsCorssPlatfom was the condition meant to use instead of matcher.isNotEmpty(), so before my change you had been using docker cli, but that's actually not intended behavior but it happened to be able to set BUILDPLATFORM variable, skaffold was supposed to use docker sdk to talk the daemon if the condition is false.
It looks like I don't have to create a custom build in order to use buildx features like multi-platform builds?
yeah, if skaffold run docker build with docker cli it should be using buildx by default if your docker engine is newer than 23.0
https://docs.docker.com/build/architecture/#buildx

from skaffold.

aizam6066 avatar aizam6066 commented on June 17, 2024

Thank you very much for the quick response there, @ericzzzzzzz! Adding useDockerCLI did fix the issue! I just have couple follow-up questions.

  1. Why do you think it started breaking now after a year or so of us not having this key in our skaffold.yaml. The only thing I can think of is GH runners install the latest skaffold version and somewhere in the later version updates, this started to break?
  2. I had read that docker doc you shared above and I had tried without success before you replied adding useBuildKit to my local because it seemed like docker default driver, which I thought skaffold used, did not support buildx and multi-platform build and I had to specify a buildKit. It looks like I don't have to create a custom build in order to use buildx features like multi-platform builds?

Thanks again!

from skaffold.

aizam6066 avatar aizam6066 commented on June 17, 2024

Great! Thank you for the explanation. Clears up my confusion.

from skaffold.

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.