{"id":15068495,"url":"https://github.com/lobz1g/docen","last_synced_at":"2026-01-30T17:31:18.314Z","repository":{"id":53490067,"uuid":"352413420","full_name":"lobz1g/docen","owner":"lobz1g","description":"Small utility for generating Dockerfile for golang projects","archived":false,"fork":false,"pushed_at":"2021-04-07T14:07:59.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-04T22:47:06.781Z","etag":null,"topics":["dockefile","docker","generating","generator","golang","tool","tools","utility"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lobz1g.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":"2021-03-28T18:58:07.000Z","updated_at":"2021-04-07T14:00:53.000Z","dependencies_parsed_at":"2022-08-19T11:20:09.626Z","dependency_job_id":null,"html_url":"https://github.com/lobz1g/docen","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/lobz1g/docen","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lobz1g%2Fdocen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lobz1g%2Fdocen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lobz1g%2Fdocen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lobz1g%2Fdocen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lobz1g","download_url":"https://codeload.github.com/lobz1g/docen/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lobz1g%2Fdocen/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28916075,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T16:37:38.804Z","status":"ssl_error","status_checked_at":"2026-01-30T16:37:37.878Z","response_time":66,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["dockefile","docker","generating","generator","golang","tool","tools","utility"],"created_at":"2024-09-25T01:37:52.045Z","updated_at":"2026-01-30T17:31:18.288Z","avatar_url":"https://github.com/lobz1g.png","language":"Go","readme":"[![Go Report Card](https://goreportcard.com/badge/github.com/lobz1g/docen)](https://goreportcard.com/report/github.com/lobz1g/docen)\n\n# Docen\n\nSimple utility for generating Dockerfile for golang projects.\n\n## Installation\n\n```shell\ngo get github.com/lobz1g/docen\n```\n\n## Usage\n\n```go\npackage main\n\nimport (\n\t\"log\"\n\n\t\"github.com/lobz1g/docen\"\n)\n\nfunc main() {\n\terr := docen.New().\n\t\tSetGoVersion(\"1.14.9\").\n\t\tSetPort(\"3000\").\n\t\tSetTimezone(\"Europe/Moscow\").\n\t\tSetTestMode(true).\n\t\tSetAdditionalFolder(\"my-folder/some-files\").\n\t\tSetAdditionalFile(\"another-folder/some-files/file\").\n\t\tGenerateDockerfile()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n```\n\nDockerfile will be created in the root dir of the project.\n\n```dockerfile\nFROM golang:1.14.9-alpine as builder\nRUN apk update \u0026\u0026 apk add --no-cache git ca-certificates tzdata \u0026\u0026 update-ca-certificates\nRUN adduser -D -g '' appuser\nRUN mkdir -p /docen\nRUN mkdir -p /docen/my-folder/some-files\nRUN mkdir -p /docen/another-folder/some-files\nCOPY . /docen\nWORKDIR /docen\nRUN CGO_ENABLED=0 go test ./...\nRUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build  -ldflags=\"-w -s\" -o /docen\nFROM scratch\nCOPY --from=builder /usr/share/zoneinfo /usr/share/zoneinfo\nCOPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/\nCOPY --from=builder /etc/passwd /etc/passwd\nENV TZ=Europe/Moscow\nCOPY --from=builder /docen /docen\nCOPY --from=builder /docen/my-folder/some-files /docen/my-folder/some-files\nCOPY --from=builder /docen/another-folder/some-files /docen/another-folder/some-files\nCOPY --from=builder /docen/another-folder/some-files/file /docen/another-folder/some-files/file\nUSER appuser\nEXPOSE 3000\nENTRYPOINT [\"/docen\"]\n```\n\n## Options\n\nAll methods are optional. That means there are default values for success creating Dockerfile without any settings.\n\nJust use below code for generating Dockerfile with default values:\n\n```go\nerr := docen.New().GenerateDockerfile()\nif err != nil {\n    log.Fatal(err)\n}\n```\n\n### Image\n\nBy default, the image name is `golang` and the tag is `{your_golang_version}-aplpine`. If the `runtime.Version` method\nreturns wrong information about your golang version it will be just `alpine` image tag. You can set the version by\nmethod `SetGoVersion` without any settings.\n\n### Expose port\n\nBy default, Dockerfile will be without the expose port field. You can set the port by method `SetPort`. The argument can\nbe a single value of port, for example `3000`, or a range of values, for example `3000-4000`.\n\n### Timezone\n\nBy default, Dockerfile will be without the timezone env field. You can set the timezone by method `SetTimezone`.\n\n### Testing\n\nThe image is built without testing, but you can test the app before build. Use the method `SetTestMode` for it.\n\n### Additional folders to image\n\nSuch folders as `assets`, `config`, `static` and `templates` are added to the image. You can add additional folders by\nmethod `SetAdditionalFolder`.\n\n### Additional files to image\n\nYou can set additional files which should be added to the image. Use the `SetAdditionalFile` method for it. It also adds\nadditional folders for these files.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flobz1g%2Fdocen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flobz1g%2Fdocen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flobz1g%2Fdocen/lists"}