{"id":13821020,"url":"https://github.com/pablo-ruth/go-init","last_synced_at":"2025-05-16T11:30:58.719Z","repository":{"id":56323851,"uuid":"109429402","full_name":"pablo-ruth/go-init","owner":"pablo-ruth","description":"A minimal init system for containers with pre/post hooks","archived":true,"fork":false,"pushed_at":"2024-08-27T16:56:20.000Z","size":10,"stargazers_count":45,"open_issues_count":1,"forks_count":18,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-19T20:47:00.760Z","etag":null,"topics":["docker","go","golang","init","init-system"],"latest_commit_sha":null,"homepage":null,"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/pablo-ruth.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":"2017-11-03T18:25:03.000Z","updated_at":"2024-08-27T16:56:39.000Z","dependencies_parsed_at":"2024-11-19T20:35:00.301Z","dependency_job_id":"1ff46389-24e4-4d09-94b5-da1c943325b2","html_url":"https://github.com/pablo-ruth/go-init","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pablo-ruth%2Fgo-init","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pablo-ruth%2Fgo-init/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pablo-ruth%2Fgo-init/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pablo-ruth%2Fgo-init/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pablo-ruth","download_url":"https://codeload.github.com/pablo-ruth/go-init/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254521745,"owners_count":22084977,"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","go","golang","init","init-system"],"created_at":"2024-08-04T08:01:13.863Z","updated_at":"2025-05-16T11:30:54.570Z","avatar_url":"https://github.com/pablo-ruth.png","language":"Go","readme":"# go-init\n\n⚠️ **Note: This repository is no longer maintained. A maintained fork is available at [https://github.com/adambkaplan/go-init](https://github.com/adambkaplan/go-init).**\n\n[![No Maintenance Intended](http://unmaintained.tech/badge.svg)](http://unmaintained.tech/)\n[![Build Status](https://travis-ci.org/pablo-ruth/go-init.svg?branch=master)](https://travis-ci.org/pablo-ruth/go-init)\n\n**go-init** is a minimal init system with simple *lifecycle management* heavily inspired by [dumb-init](https://github.com/Yelp/dumb-init).\n\nIt is designed to run as the first process (PID 1) inside a container.\n\nIt is lightweight (less than 500KB after UPX compression) and statically linked so you don't need to install any dependency.\n\n## Download\n\nYou can download the latest version on [releases page](https://github.com/pablo-ruth/go-init/releases)\n\n## Why you need an init system\n\nI can't explain it better than Yelp in *dumb-init* repo, so please [read their explanation](https://github.com/Yelp/dumb-init/blob/v1.2.0/README.md#why-you-need-an-init-system)\n\nSummary:\n- Proper signal forwarding\n- Orphaned zombies reaping\n\n## Why another minimal init system\n\nIn addition to *init* problematic, **go-init** tries to solve another Docker flaw by adding *hooks* on start and stop of the main process.\n\nIf you want to launch a command before the main process of your container and another one after the main process exit, you can't with Docker, see [issue 6982](https://github.com/moby/moby/issues/6982)\n\nWith **go-init** you can do that with \"pre\" and \"post\" hooks.\n\n## Usage\n\n### one command\n\n```\n$ go-init -main \"my_command param1 param2\"\n```\n\n### pre-start and post-stop hooks\n\n```\n$ go-init -pre \"my_pre_command param1\" -main \"my_command param1 param2\" -post \"my_post_command param1\"\n```\n\n## docker\n\nExample of Dockerfile using *go-init*:\n```\nFROM alpine:latest\n\nCOPY go-init /bin/go-init\n\nRUN chmod +x /bin/go-init\n\nENTRYPOINT [\"go-init\"]\n\nCMD [\"-pre\", \"echo hello world\", \"-main\", \"sleep 5\", \"-post\", \"echo I finished my sleep bye\"]\n```\n\nBuild it:\n```\ndocker build -t go-init-example\n```\n\nRun it:\n```\ndocker run go-init-example\n```\n","funding_links":[],"categories":["Go"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpablo-ruth%2Fgo-init","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpablo-ruth%2Fgo-init","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpablo-ruth%2Fgo-init/lists"}