Building multi-architecture docker images with Skaffold

2/5/2020

I've been able to get two awesome technologies to work independently.

Unfortunatly I don't know how to use them both at the same time.

I'm currently building and testing on my laptop (amd), then deploying to a Raspberri Pi 4 (arm64) running Kubernetes.

To get this working I use something like:

docker buildx build --platform linux/amd64,linux/arm64 --tag my-registry/my-image:latest   --push  .

Before attempting to target an arm I was using skaffold.

Is there any way to continue to target multi-playform whilst also using skaffold to build/deploy? If not, is there any recommendations for alternatives?

Any advice/help is very appreciated, thank-you.

-- MaybeARabbit
arm64
docker
kubernetes
pi
skaffold

2 Answers

2/5/2020

I think you need to install a driver in order to use both.

https://medium.com/nttlabs/buildx-kubernetes-ad0fe59b0c64

Edit here is an implementation example with a GO qiita.com/J_Shell/items/beb266ef65270217a9ed (please use the translator)

-- Theophane Fotso
Source: StackOverflow

2/6/2020

Found the missing piece. Skaffold has the ability to set a custom command, where I could use buildx.

https://github.com/GoogleContainerTools/skaffold/tree/master/examples/custom

build:
  artifacts:
  - image: "foo/bar"
    context: .
    custom:
      buildCommand: ./custom-build.sh

custom-build.sh

docker buildx build \
  --platform linux/arm64 \
  --tag $IMAGE \
  --push \
  $BUILD_CONTEXT
-- MaybeARabbit
Source: StackOverflow