← 返回刚才阅读的位置

知识卡片

普通读书笔记卡 · 4545.g.7

静态部署须核对构建依赖

理解等级:高级

把Go运行时和所需Go代码编译进可执行文件,能减少部署时额外语言运行时与包环境冲突,适合较小容器镜像。补充边界:是否完全静态还取决于cgo、外部库和构建方式;证书、时区或配置等运行资料也应另行确认。不能把原书的部署优点写成任意Go二进制在scratch中必定可用。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • Why Go Rules the Cloud Native World · 查看原书依据

      By default, Go programs are compiled directly into native, statically-linked executable binaries into which all necessary Go libraries and the Go runtime are copied. This produces slightly larger files (on the order of about 2MB for a “hello world”), but the resulting binary has no external language runtime to install17 or external library dependencies to

    参考来源

    - 位置:《Cloud Native Go》第02章《Why Go Rules the Cloud Native World》(来源项目book-sources;源文件:extracted/Cloud Native Go (Matthew A. Titmus)/_epub-src/OEBPS/ch02.xhtml) - 结论依据:把Go运行时和所需Go代码编译进可执行文件,能减少部署时额外语言运行时与包环境冲突,适合较小容器镜像。原文相应定义、示例或限制为此结论提供依据;补充纠错与版本边界在正文就近标明。 - 原始内容:By default, Go programs are compiled directly into native, statically-linked executable binaries into which all necessary Go libraries and the Go runtime are copied. This produces slightly larger files (on the order of about 2MB for a “hello world”), but the resulting binary has no external language runtime to install17 or external library dependencies to