||3 months ago|
|.chglog||3 months ago|
|example||3 months ago|
|tools||4 months ago|
|.gitignore||4 months ago|
|.goreleaser.yml||4 months ago|
|CHANGELOG.md||3 months ago|
|Dockerfile||4 months ago|
|LICENSE||4 months ago|
|Makefile||4 months ago|
|README.md||3 months ago|
|_config.yml||4 months ago|
|go.mod||3 months ago|
|go.sum||4 months ago|
|main.go||4 months ago|
|version.go||4 months ago|
cinit is a minimal and correctly functioning init (PID 1) for Docker
Containers running in Swarm clusters that supports the following features:
- Reading secrets from Swarm (
/run/secrets) and injecting them as env vars.
- Optional pre and post hooks (TBD)
See example for a full working example of embedding the
binary into your
Dockerfiel and an example contrived service you would
deploy to a Swarm cluster with
docker stack deploy ....
Simply add the
cinit binary to your
FROM alpine:latest ADD https://git.mills.io/prologic/cinit/releases/download/0.0.2/cinit_0.0.2_Linux_x86_64 /cinit RUN chmod 755 /cinit
And ensure that
/cinit is the entrypoint of your image:
CMD is your normal process to be started. When you deploy your service
to a Swarm cluster, any secrets defined for the service and normally available
/run/secrets of the running container(s) are injected as environment
variables before running your process.
- Your process is "supervised" and zombie processes reaped.
- All signals are forwarded to your process as expected.
As a bonus (mostly for interactive and development purposes)
supports terminals and automatically detects if being run with a connected
docker run -i -t test-cinit /bin/sh`
This is inspired by other similar projects:
- envconsul Launch a subprocess with environment variables using data from @hashicorp Consul and Vault.
- dinit An init for use inside Docker containers
- go-init A minimal init system for containers with pre/post hooks
- init Correct init process for Docker containers
cinit is licensed under the terms of the MIT License