{"id":18928545,"url":"https://github.com/nathan-osman/bettergo","last_synced_at":"2026-05-01T21:32:11.517Z","repository":{"id":143058363,"uuid":"97532339","full_name":"nathan-osman/bettergo","owner":"nathan-osman","description":"Docker container for building Go applications without running as root","archived":false,"fork":false,"pushed_at":"2017-09-08T06:56:15.000Z","size":4,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-25T01:43:51.682Z","etag":null,"topics":["docker","golang"],"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/nathan-osman.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":"2017-07-17T23:52:03.000Z","updated_at":"2025-02-21T19:42:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"f4401cb2-2c36-4d06-b00b-14e76d8d0e56","html_url":"https://github.com/nathan-osman/bettergo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nathan-osman/bettergo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathan-osman%2Fbettergo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathan-osman%2Fbettergo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathan-osman%2Fbettergo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathan-osman%2Fbettergo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nathan-osman","download_url":"https://codeload.github.com/nathan-osman/bettergo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathan-osman%2Fbettergo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32513533,"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":["docker","golang"],"created_at":"2024-11-08T11:26:16.378Z","updated_at":"2026-05-01T21:32:11.485Z","avatar_url":"https://github.com/nathan-osman.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"## bettergo\n\nThe [`golang` repository](https://hub.docker.com/_/golang/) on Docker Hub is useful for building Go applications in a container without requiring the host to have the Go toolchain installed. Typical usage would look something like this:\n\n    mkdir dist\n    docker run \\\n        --rm \\\n        -v `pwd`/dist:/go/bin \\\n        golang \\\n        go get github.com/hectane/hectane\n\nIf successful, the `dist/` directory will contain an executable named `hectane` when the command completes.\n\nOne small problem: _`dist/hectane` is owned by root_.\n\nYou can still remove the directory with `rm` but even that will fail if there are subdirectories.\n\nThat's where bettergo comes in. Instead of running commands in the container as root, bettergo takes a completely different approach: create a user in the container that matches the current user on the host. What does this look like?\n\n    mkdir dist\n    docker run \\\n        --rm \\\n        -v `pwd`/dist:/go/bin \\\n        -e UID=`id -u` \\\n        nathanosman/bettergo \\\n        go get github.com/hectane/hectane\n\nThe only differences are the repository name and the addition of the environment variable `UID`, which is initialized with the current user's ID. The container will then create the appropriate entries in `/etc/passwd` and `/etc/shadow` for you and then run the `go get` command as the new user.\n\nOnce the command completes, everything inside `dist` is owned by... you! That's right, you are the owner of the files inside the directory once again.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnathan-osman%2Fbettergo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnathan-osman%2Fbettergo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnathan-osman%2Fbettergo/lists"}