> For the complete documentation index, see [llms.txt](https://golang-2.gitbook.io/handbook/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://golang-2.gitbook.io/handbook/xiang-mu-guan-li/chi-xu-ji-cheng.md).

# 持续集成

### 镜像构建

使用各种不同的流水线引擎构建golang程序时，其构建命令往往不同，为了使构建过程能够通用化，建议使用容器方式编译构建。

在使用Dockerfile构建golang程序时，可以使用官方镜像docker.io/library/golang。为了使构建出的镜像尽量轻量化，建议使用alpine:3.10做为发布构建用的镜像，由于golang编译时可能会依赖到一部分c++库，在选择编译用的镜像时建议使用golang:1.13-alpine3.10，使用其他的镜像做编译可能会出现在运行发布镜像时，因为缺失运行库而导致无法正常运行程序的情况。
