使用 Skaffold 构建多架构 docker 镜像 [英] Building multi-architecture docker images with Skaffold

查看:76
本文介绍了使用 Skaffold 构建多架构 docker 镜像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经能够让两种很棒的技术独立工作.

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.

我目前正在我的笔记本电脑 (amd) 上构建和测试,然后部署到运行 Kubernetes 的 Raspberri Pi 4 (arm64).

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.

有什么方法可以在使用 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.

推荐答案

找到了缺失的部分.Skaffold 能够设置自定义命令,我可以在其中使用 buildx.

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/示例/自定义

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

这篇关于使用 Skaffold 构建多架构 docker 镜像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆