# golang 代码构建制品上传示例 当前仓库,用于演示(详见 `.cnb.yml`): - `golang` 代码如何构建镜像并发布到 CNB Docker 仓库。 - `golang` 代码如何构建二进制包并上传到 release 和 commit 附件。 ![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 镜像 镜像:`docker.cnb.cool/examples/ecosystem/golang-build:latest` [Docker 制品详情](https://cnb.cool/examples/ecosystem/golang-build/-/packages/docker/golang-build) 如何使用: ```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/8591d26cc646f9fab26795bb43dab8dedbfd64e3)