{"id":13572506,"url":"https://github.com/redbooth/gockerize","last_synced_at":"2025-04-05T18:12:10.665Z","repository":{"id":35872656,"uuid":"40157863","full_name":"redbooth/gockerize","owner":"redbooth","description":"Package golang service into minimal docker containers.","archived":false,"fork":false,"pushed_at":"2018-03-02T17:32:26.000Z","size":57,"stargazers_count":666,"open_issues_count":0,"forks_count":20,"subscribers_count":63,"default_branch":"master","last_synced_at":"2025-03-29T17:13:16.873Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/redbooth.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-08-04T02:02:07.000Z","updated_at":"2025-02-19T17:25:40.000Z","dependencies_parsed_at":"2022-09-08T17:30:54.878Z","dependency_job_id":null,"html_url":"https://github.com/redbooth/gockerize","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/redbooth%2Fgockerize","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redbooth%2Fgockerize/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redbooth%2Fgockerize/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redbooth%2Fgockerize/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/redbooth","download_url":"https://codeload.github.com/redbooth/gockerize/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247378152,"owners_count":20929297,"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":[],"created_at":"2024-08-01T14:01:25.545Z","updated_at":"2025-04-05T18:12:10.649Z","avatar_url":"https://github.com/redbooth.png","language":"Shell","readme":"gockerize\n=========\n\nBuild static golang binaries and package them into minimal docker containers\n\n\u003cimg src=\"gockerize.png\" alt=\"gockerize\" width=\"500px\" /\u003e\n\nLicense\n-------\n\nBSD 3-Clause, see accompanying LICENSE file.\n\n\nRequirements\n------------\n\n  - bash\n  - docker 1.5+\n\n\nUsage\n-----\n\n    gockerize \u003cimage\u003e \u003cpackage\u003e [\u003csource\u003e [\u003cmapping\u003e [\u003cDockerfile\u003e]]]\n\n\nThe default use case is to call the script from the root directory of\nthe package being built, with any dependencies vendored in and the\nDockerfile at the root of the package.\n\n#### Arguments\n\nThe `image` argument determines the name of the resulting Docker image.\n\nThe `package` argument is the fully qualified name of the package being\nbuilt.\n\nThe `source` argument can be used to easily include non-vendored dependencies\ninto the build context. For instance, given the following hierarchy:\n\n    src/\n        acme.com/\n            common/\n            foo/\n\nWhere `foo` is the service to be built and `common` is a package it depends on.\n\nThe following command can be used, from `src/acme.com/foo` :\n\n    gockerize foo acme.com/foo ..\n\nThis will result in all of `src/acme.com` being used as build context, under\n`$GOPATH/src/acme.com`.\n\nSimilarly, `mapping` can be changed from its default value to accommodate\nsource layouts that deviate from golang's conventions and `Dockerfile` can\npoint to a Dockerfile at a non-default location, including outside of the\nDocker build context.\n\nThe contents of the `GOARGS` environment variable are passed to the go build\ncommand inside the container. Among other things, this makes it easy to use\ncustom build tags.\n\n#### Dockerfile\n\nA typical Dockerfile may look like:\n\n    FROM scratch\n    ADD bin/foo /foo\n    EXPOSE 12345\n    ENTRYPOINT [ \"/foo\" ]\n\nThe Docker image is built within a temporary container and its build\ncontext is limited to the content of `GOPATH` on that container, hence\nthe reference to `bin/foo` which is the location of the binary produced\nby compiling package `acme.com/foo`.\n\n\nDependency resolution\n---------------------\n\nFor ease of use, gockerize uses `go get` to automatically fetch remote\ndependencies from github and other public repositories supported by default,\nhowever, vendored dependencies should be preferred as they ensure repeatable\nbuild.\n\nBy default, gockerize uses Go 1.5.3 and enables [GOVENDOREXPERIMENT](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo).\nHowever, it is possible to use any desired version of Go by setting the `GOVERSION`\nenvironment variable appropriately, for instance `GOVERSION=1.9.2` to build with\nGo 1.9.2\n\nPatching standard lib\n---------------------\n\nFully static builds allow easy patching of the standard library. gockerize\nleverages that by automatically applying patches found in the `patches` subdir\nof the package being built.\n\nCare should be taken that the patches cleanly apply against the version of Go\nused in the container (1.5.3 at this time).\n\n","funding_links":[],"categories":["Shell","Docker","Continuous Delivery \u0026 GitOps"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredbooth%2Fgockerize","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fredbooth%2Fgockerize","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredbooth%2Fgockerize/lists"}