# golang 代码构建镜像示例 当前仓库,用于演示 `golang` 代码如何构建镜像并发布到 CNB Docker 仓库。 ![badge](https://cnb.cool/examples/ecosystem/golang-build/-/badge/git/latest/ci/pipeline-as-code) ![badge](https://cnb.cool/examples/ecosystem/golang-build/-/badge/git/latest/ci/git-clone-yyds) ![badge](https://cnb.cool/examples/ecosystem/golang-build/-/badge/git/latest/ci/status/push) ## 示例关键代码说明 - `main.go`: 启动一个 http 服务 - `Dockerfile`: 构建镜像 - `.ide/Dockerfile`: 启动远程开发使用构建环境配置 - `.cnb.yml`: ci 配置文件 - `README.md`: 说明文件 ## 镜像 `docker.cnb.cool/examples/ecosystem/golang-build:latest` ## 使用 ```shell docker pull docker.cnb.cool/examples/ecosystem/golang-build:latest docker run docker.cnb.cool/examples/ecosystem/golang-build:latest ``` ## 二进制包 下载方式: - [releases 附件](https://cnb.cool/examples/ecosystem/golang-build/-/releases) - [commit 附件](https://cnb.cool/examples/ecosystem/golang-build/-/commit/3d9b21543b94258b3f7bde8db972c99b98ce8029)