简体   繁体   English

没有operator-sdk直接构建operator镜像?

[英]Building operator image directly without operator-sdk?

I had created my Kubernetes operator with the help of the Operator SDK Now I want to make some automatic build with my GitHub repo so when I push something to the master to trigger build of the operator image.我在Operator SDK的帮助下创建了 Kubernetes 运算符

Can I use go build + docker build (for building the image) instead of the operator-sdk build ?我可以使用go build + docker build (用于构建图像)而不是operator-sdk build吗?

Because if it is doing the same job I don't want to depend on one more tool for building the image.因为如果它在做同样的工作,我不想再依赖一种工具来构建图像。

I run operator-sdk build with --verbose and it looks like it is doing these only two thing (go build + docker build) but I am not sure.我使用--verbose运行operator-sdk build ,看起来它只做这两件事(go build + docker build),但我不确定。 There could be some validations and checks before these command if I don't want to such validations exist I don't want to skip them.如果我不想存在这样的验证,我不想跳过它们,那么在这些命令之前可能会有一些验证和检查。

Is a bad idea to use go and docker to directly build the image instead of operator-sdk ?使用godocker直接构建映像而不是operator-sdk是一个坏主意吗? Because I don't want to do something special during the build I just want to not have one more dependency in the build infrastructure if it's possible to avoid it.因为我不想在构建过程中做一些特别的事情,所以如果可以避免的话,我只想在构建基础架构中不再依赖它。

I faced a similar question and if you look at the source code for operator-sdk , it actually triggers go build and a docker build (the CLI, and not even the APIs for docker build ).我遇到了类似的问题,如果您查看operator-sdk的源代码,它实际上会触发go builddocker build (CLI,甚至不是docker build的 API)。 So yes, I wrote a simple docker file to do a go build .所以是的,我写了一个简单的 docker 文件来go build That's it.而已。

EDIT: Here's the source for how the docker build command is formed and finally run as a system command: https://github.com/operator-framework/operator-sdk/blob/master/cmd/operator-sdk/build/cmd.go#L98编辑:这是docker build命令如何形成并最终作为系统命令运行的来源: https://github.com/operator-framework/operator-sdk/blob/master/cmd/operator-sdk/build/cmd .go#L98

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 没有 Dockerfile 的 Docker 图像构建的可行性 - Feasibility of Docker image building without Dockerfile 如何在Docker中使用“ >>”运算符? - How to use “>>” operator in Docker? 在 Prometheus Operator 中创建 ServiceMonitor - Create ServiceMonitor in Prometheus Operator 我可以直接部署生成的 docker 镜像而不将其推送到 DockerHub 吗? - Can I directly deploy generated docker image without pushing it to DockerHub? 在不构建映像的情况下将本地存储库部署到Docker容器 - Deploy local repo to Docker container without building image 为什么使用 docker compose 构建和映像会失败但没有它会成功? - Why does building and image with docker compose fail but succeeds without it? Docker 健康检查和操作员 - Docker Healthcheck AND Operator 使用 airflow bash 运算符时,如果 shell 脚本位于挂载目录中,则 Docker 无法找到图像 - Docker cannot find image if shell script is in mounted directory when using airflow bash operator 我可以在不重新构建泊坞窗图像的情况下更改环境设置吗? - Can I change the enviroment setting without re building the docker image? Docker 在 Windows 上运行图像 11 给出错误 /bin/sh: 1: [: python3: unexpected operator - Docker run image on Windows 11 gives error /bin/sh: 1: [: python3: unexpected operator
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM