Skip to content

Commit 39d19a0

Browse files
committed
Add the initial Dockerfile for the stop_demo
[refs #fe9e05d2c115 #64f1a7b1e048]
1 parent 65e016f commit 39d19a0

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

stop_demo/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM alpine:latest
2+
3+
RUN apk update && apk add bash
4+
COPY traptest.sh /
5+
6+
CMD ["/traptest.sh"]

stop_demo/traptest.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env bash
2+
trap "echo Received SIGTERM > /dev/stderr" SIGTERM
3+
trap "echo Received SIGINT > /dev/stderr" SIGINT
4+
trap "echo Received SIGHUP > /dev/stderr" SIGHUP
5+
trap "echo Received SIGQUIT > /dev/stderr" SIGQUIT
6+
echo "Started with PID $$"
7+
8+
while : # This is the same as "while true".
9+
do
10+
sleep 0.1 # This script is not really doing anything.
11+
wait
12+
done

0 commit comments

Comments
 (0)