Everlasting "Hey, Yo!" per second
$ docker run public.ecr.aws/toricls/everlasting-hey-yo
then, you'll see everlasting "Hey, Yo!" per second.
Hey, Yo!
Hey, Yo!
...
Hey-yo container is meant to know the duration between SIGTERM
and its subsequent SIGKILL
, roughly.
You can use Hey-yo to make sure that your container orchestrator issues docker stop
with --stop
option (or, docker run
with --stop-timeout
option) as expected.
Hey-yo container react to a SIGTERM signal but does not stop by default.
Let's try sending a SIGTERM signal to your Hey-Yo container with the following command:
$ docker stop YOUR-CONTAINER-ID
then, you'll see the following line and Hey-Yo container will keep running.
...
Hey, Yo!
Hey, Hey, Hey, Yo!!! π Hey-Yo container reacted to the SIGTERM signal, and keep running!
Hey, Yo!
Hey, Yo!
...
You can change its behavior by specifying environment variables.
Hey-Yo container stops with a SIGTERM signal.
$ docker run -e LET_ME_DIE=1 public.ecr.aws/toricls/everlasting-hey-yo
$ docker run -e GIVE_ME_PATTERN=1 public.ecr.aws/toricls/everlasting-hey-yo
then you'll see randomized, but meaningless, output.
...
Hey, Yo!
A lot of Hey, Yo!
Hey, Yo!
Hey, Yo!
A lot of Hey, Yo!
A lot of Hey, Yo!
Hey, Yo!
Hey, Yo!
Hey, Yo!
...
$ docker run -e TIMESTAMP=1 public.ecr.aws/toricls/everlasting-hey-yo
then you'll see timestamp-ed log output.
...
2020-05-07T11:17:05+0000 Hey, Yo!
2020-05-07T11:17:06+0000 Hey, Yo!
2020-05-07T11:17:07+0000 Hey, Yo!
2020-05-07T11:17:08+0000 Hey, Yo!
2020-05-07T11:17:09+0000 Hey, Yo!
...
$ docker build -t YOUR-NAME/everlasting-hey-yo .
$ docker push YOUR-NAME/everlasting-hey-yo
You can use toricls/everlasting-hey-yo:latest
instead of public.ecr.aws/toricls/everlasting-hey-yo:latest
.
- Fork (https://github.com/toricls/everlasting-hey-yo/fork)
- Create a feature branch
- Commit your changes
- Rebase your local changes against the master branch
- Create a new Pull Request