Azure / Azure/azure-functions-docker

Signal handling for graceful shutdown

Open
#404 12 comments 0 reactions 1 assignee Claimed by @balag0 View on GitHub
Dominant language
Dockerfile
Stars
280
Forks
126
PR merge metrics
No merged PRs in 30d

Description

I use dotnet:3.0-appservice image for golang based custom handler on Linux. I want to handle signals such as SIGINT/SIGTERM on custom handler, but it seems that we cannot do it because of start.sh (PID 1) does not handle these signals.

At the moment, we have to wait 10 seconds and get exit code 137 (SIGKILL) when I stop the container. Not graceful.

So, I manage it with [domb-init](https://github.com/Yelp/dumb-init) as a workaround.

```Dockefile
[snip]
RUN wget -O /usr/local/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.5/dumb-init_1.2.5_x86_64
RUN chmod +x /usr/local/bin/dumb-init

ENTRYPOINT ["/usr/local/bin/dumb-init", "--"]
CMD ["bash", "/azure-functions-host/start.sh"]
```

Could you please consider implementation of handling logic on start.sh or publishing official guidelines? Thanks.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.