{"id":26094991,"url":"https://github.com/brimstone/docker-golang","last_synced_at":"2025-04-12T10:07:10.434Z","repository":{"id":142764116,"uuid":"147344991","full_name":"brimstone/docker-golang","owner":"brimstone","description":"Docker image for cross compiling go with CGO for linux (desktops and Raspberry Pis), Windows, MacOS, and FreeBSD","archived":false,"fork":false,"pushed_at":"2025-04-01T19:00:13.000Z","size":126,"stargazers_count":6,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-12T10:05:39.378Z","etag":null,"topics":["docker-image","freebsd","golang","linux","musl","raspberrypi","windows"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/brimstone.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":"2018-09-04T12:47:55.000Z","updated_at":"2025-04-01T19:00:17.000Z","dependencies_parsed_at":"2023-12-05T21:23:25.474Z","dependency_job_id":"7d35d2cb-6173-461a-9f51-21c05e1b3b3d","html_url":"https://github.com/brimstone/docker-golang","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brimstone%2Fdocker-golang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brimstone%2Fdocker-golang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brimstone%2Fdocker-golang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brimstone%2Fdocker-golang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brimstone","download_url":"https://codeload.github.com/brimstone/docker-golang/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248550633,"owners_count":21122933,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["docker-image","freebsd","golang","linux","musl","raspberrypi","windows"],"created_at":"2025-03-09T13:11:54.312Z","updated_at":"2025-04-12T10:07:10.416Z","avatar_url":"https://github.com/brimstone.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"golang\n======\n\nThis is a container to build golang static binaries with cgo musl for amd64, glibc for darwin, freebsd, and windows\n\n[![microbadger][1]][2] [![docker hub][3]][4]\n\n[1]: https://images.microbadger.com/badges/image/brimstone/golang.svg\n[2]: https://microbadger.com/images/brimstone/golang\n[3]: https://img.shields.io/docker/automated/brimstone/golang.svg\n[4]: https://hub.docker.com/r/brimstone/golang\n\n\nUsage\n-----\n\nCheck out your source files to a GOPATH compatible directory:\n\n```bash\nmkdir -p src/github.com/user\ngit clone https://github.com/user/repo.git src/github.com/user/repo\n```\n\nThen build!\n\n```bash\ndocker run --rm -it -v \"$PWD:/go\" -u \"$UID:$GID\" brimstone/golang github.com/user/repo\n```\n\nAlternate build\n---------------\n\nFor when another repo is included in a `src` directory, for instance, a submodule:\n```bash\ntar c src \\\n| docker run --rm -i -e TAR=1 brimstone/golang github.com/user/repo \\\n| tar -x ./main\n```\n\nFor when there's just source files in a diretory:\n```bash\ntar c . \\\n| docker run --rm -i -e TAR=1 brimstone/golang -o main \\\n| tar -x ./main\n```\n\n\nEnvironment Variables\n---------------------\n\n`VERBOSE` This makes the loader script more verbose\n\nONBUILD\n-------\n\nThis image supports docker multistage builds. Simply use this as template for your Dockerfile:\n```\nARG REPOSITORY=github.com/brimstone/example\nFROM brimstone/golang as builder\n\nFROM scratch\nENV ADDRESS=\nEXPOSE 80\nENTRYPOINT [\"/repo\", \"serve\"]\nCOPY --from=builder /app /repo\n```\n\nThen build with this:\n```\ndocker build -t user/repo --build-arg PACKAGE=github.com/user/repo .\n```\n\nReferences\n----------\n\nhttp://dominik.honnef.co/posts/2015/06/statically_compiled_go_programs__always__even_with_cgo__using_musl/\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrimstone%2Fdocker-golang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrimstone%2Fdocker-golang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrimstone%2Fdocker-golang/lists"}