{"id":22007007,"url":"https://github.com/t-matsuo/cocker","last_synced_at":"2026-05-04T14:32:10.340Z","repository":{"id":65195600,"uuid":"409889119","full_name":"t-matsuo/cocker","owner":"t-matsuo","description":"Cocker is pre processer for Dockerfile.","archived":false,"fork":false,"pushed_at":"2023-06-11T14:05:08.000Z","size":61,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-23T07:11:43.408Z","etag":null,"topics":["docker","dockerfile","preprocessor"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/t-matsuo.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-24T08:26:06.000Z","updated_at":"2024-10-14T01:49:18.000Z","dependencies_parsed_at":"2024-06-21T11:45:06.035Z","dependency_job_id":"d36b8273-d73a-4579-beb9-314db2ea31b7","html_url":"https://github.com/t-matsuo/cocker","commit_stats":{"total_commits":27,"total_committers":1,"mean_commits":27.0,"dds":0.0,"last_synced_commit":"a53dcdbec08737cf823d1c5c186d2ad6d0b5d22d"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/t-matsuo/cocker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t-matsuo%2Fcocker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t-matsuo%2Fcocker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t-matsuo%2Fcocker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t-matsuo%2Fcocker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/t-matsuo","download_url":"https://codeload.github.com/t-matsuo/cocker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t-matsuo%2Fcocker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32611661,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"ssl_error","status_checked_at":"2026-05-04T10:08:02.005Z","response_time":58,"last_error":"SSL_read: 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":["docker","dockerfile","preprocessor"],"created_at":"2024-11-30T01:16:14.945Z","updated_at":"2026-05-04T14:32:10.324Z","avatar_url":"https://github.com/t-matsuo.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cocker\n\nCocker is pre processer for Dockerfile.\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/t-matsuo/cocker)](https://goreportcard.com/report/github.com/t-matsuo/cocker)\n\nIt provides these features.\n\n* merge RUN command \n* split RUN command\n* include another Dockerfile\n\n## Usage\n\nMerge (use -m option)  \nKeyword `#break` breaks merging RUN\n\n```\n$ cat Dockerfile\nFROM centos:7\nRUN echo 1\nRUN echo 2\nRUN echo 3\n#break\nRUN echo 4\n```\n```\n$ cocker -m Dockerfile\nFROM centos:7\nRUN echo 1 \u0026\u0026 \\\n    echo 2 \u0026\u0026 \\\n    echo 3\nRUN echo 4\n```\n\nSplit (use -s option)\n\n```\n$ cat Dockerfile\nFROM centos:7\nRUN echo 1 \u0026\u0026 \\\n    echo 2 \u0026\u0026 \\\n    echo 3\n```\n```\n$ cocker -s Dockerfile\nFROM centos:7\nRUN echo 1\nRUN echo 2\nRUN echo 3\n```\n\nInclude (use -i option) \n\nNote : It includes files recursively, but it cannot detect loop. You can use \"ifdef\" or \"ifndef\" option to switch condition.\n\n```\n$ cat Dockerfile\nFROM centos:7\nRUN echo 1\nRUN echo 2\n#include Dockerfile.inc1\n#include Dockerfile.inc2 ifdef MY_ENV1\n#include Dockerfile.inc3 ifdef MY_ENV2\n#include Dockerfile.inc4 ifndef MY_ENV1\n```\n```\n$ cat Dockerfile.inc \nRUN echo a\nRUN echo b\n$ cat Dockerfile.inc2\nRUN echo c\nRUN echo d\n$ cat Dockerfile.inc3\nRUN echo e\nRUN echo f\n$ cat Dockerfile.inc4\nRUN echo g\nRUN echo h\n```\n```\n$ export MY_ENV2=\"\"\n$ cocker -i Dockerfile\nFROM centos:7\nRUN echo 1\nRUN echo 2\nRUN echo a\nRUN echo b\nRUN echo e\nRUN echo f\nRUN echo g\nRUN echo h\n```\n\nCondition (use -c option)\n\n```\n$ export MY_ENV=\"\"\n$ cat Dockerfile\nFROM centos:7\nRUN echo 1\nRUN echo 2\n#ifndef MY_ENV\nRUN echo 3\nRUN echo 4\n#endif\n#ifdef MY_ENV\nRUN echo 5\nRUN echo 6\n#endif\n```\n```\n$ cocker -c Dockerfile\nFROM centos:7\nRUN echo 1\nRUN echo 2\nRUN echo 5\nRUN echo 6\n```\n\n## Help\n\n```\n$ cocker -h\n\nCocker is pre processor for Dockerfile.\n\nUsage:\n  $ cocker [options...] filename\n  $ cat Dockerfile | cocker [options...]\n\nOptions:\n   -m --merge   : Merge RUN mode (cannot use -s option)\n   -s --split   : Split RUN mode (cannot use -m option)\n   -i --include : Include another Dockerfile\n   -d --debug   : Print debug messages\n   -c --condition : Handle ifdef/ifndef condition only\n   --version    : Show version number\n   -h --help    : Show help\n\nEnvironment Variables:\n   CC_DEBUG=true : Print debug messages (=--debug option)\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ft-matsuo%2Fcocker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ft-matsuo%2Fcocker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ft-matsuo%2Fcocker/lists"}