{"id":19448824,"url":"https://github.com/suhanyujie/go-docker","last_synced_at":"2026-05-01T21:05:09.400Z","repository":{"id":83545966,"uuid":"267190523","full_name":"suhanyujie/go-docker","owner":"suhanyujie","description":"go environment for dev","archived":false,"fork":false,"pushed_at":"2020-06-01T01:23:33.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-25T09:17:58.232Z","etag":null,"topics":["debian","docker","environment","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/suhanyujie.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-27T01:25:43.000Z","updated_at":"2020-06-01T01:23:35.000Z","dependencies_parsed_at":"2023-07-10T13:44:41.076Z","dependency_job_id":null,"html_url":"https://github.com/suhanyujie/go-docker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/suhanyujie/go-docker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suhanyujie%2Fgo-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suhanyujie%2Fgo-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suhanyujie%2Fgo-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suhanyujie%2Fgo-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/suhanyujie","download_url":"https://codeload.github.com/suhanyujie/go-docker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suhanyujie%2Fgo-docker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32512691,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["debian","docker","environment","golang"],"created_at":"2024-11-10T16:28:43.738Z","updated_at":"2026-05-01T21:05:09.373Z","avatar_url":"https://github.com/suhanyujie.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Go 开发/运行环境\n* go 环境的镜像构建\n\n## 镜像\n### Go 官方版\n* 基于明确的语义版本 `1.14.3`\n    `docker pull golang:1.14.3-buster`\n* 简单地启动一个测试容器：`docker run --name go1 --rm -it golang:1.14.3-buster bash`\n\n### Go 定制版\n* `docker build -t docker_go:0.1.0 .`\n    * 测试运行 `docker run --name e_go1 --rm -it docker_go:0.1.0 bash`\n\n### 使用\n* 在当前目录下，使用 docker-compose 启动（推荐）：`docker-compose up --build -d`\n\n## 附录\n### 镜像构建层级概览\n\n![](docs/docker-env-layout.jpg)\n\n### 镜像 tags 意义\n* `alpine` 就是精简版，而 `buster`,`stretch`,`jessie` 是基于 Debian 套件发行版的代码版本名称来命名。\n* Debian 是另一个 Linux 系统发行版，类似于 Ubuntu\n\n```\nDebian 10（buster） — 当前的稳定版（stable）\nDebian 9（stretch） — 旧的稳定版（oldstable）\nDebian 8（jessie） — 更旧的稳定版（oldoldstable）\nDebian 7（wheezy） — 被淘汰的稳定版\n```\n\n### 拉取镜像慢\n* 可以使用国内镜像源 https://www.cnblogs.com/zhangrui153169/p/12699077.html\n\n## 规范\n* 使用 gofmt 程序对代码进行格式化，保证格式统一\n\n### 设计相关\n* 有针对性地对目前 PHP 系统中的痛点进行设计，避免之前 PHP 中遇到的问题：\n    * 单点问题\n    * 日志问题\n    * 代码风格，使用 `gofmt`(https://gocn.vip/wiki/effective) 解决\n    * debug，使用 [delve](https://github.com/go-delve/delve) 解决，可用它进行[命令行调试](https://davidlovezoe.wordpress.com/2019/01/24/ golang-debug-intermediate/) 以及远程调试\n\n## 参考\n* 镜像名称的意义 https://segmentfault.com/q/1010000021722055\n* docker-compose file https://docs.docker.com/compose/compose-file/\n* go 模块代理 https://goproxy.cn/\n* 5分钟用Docker搭建开发环境 https://cloud.tencent.com/developer/article/1584875\n* go 开发调试3篇 https://gocn.vip/topics/9197\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuhanyujie%2Fgo-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuhanyujie%2Fgo-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuhanyujie%2Fgo-docker/lists"}