Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Run dumb-init with --single-child for graceful termination #4913

Merged
merged 3 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ RUN apk add --no-cache \
bash~=5 \
openssh~=9 \
dumb-init~=1 \
gcompat~=1
gcompat~=1 \
coreutils-env~=9

# Set the entry point to the atlantis user and run the atlantis command
USER atlantis
Expand Down
8 changes: 7 additions & 1 deletion docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
#!/usr/bin/dumb-init /bin/sh
#!/usr/bin/env -S dumb-init --single-child /bin/sh

# dumb-init is run in single child mode. By default dumb-init will forward
# interrupts to all child processes, causing Terraform to cancel and Terraform
# providers to exit uncleanly. We forward the signal to Atlantis only, allowing
# it to trap the interrupt, and exit gracefully.

set -e

# Modified: https://github.com/hashicorp/docker-consul/blob/2c2873f9d619220d1eef0bc46ec78443f55a10b5/0.X/docker-entrypoint.sh
Expand Down