diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2019-02-12 12:01:23 -0500 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2019-02-12 12:01:23 -0500 |
commit | cc49a8c9ca40eaf0dce444c3028f88de89f9578f (patch) | |
tree | e5c692dfc3f51e529b1cf9be3503da3965ca1d8b | |
parent | a6f0d0a38ea52a202252b871cb00e8b5f604d105 (diff) | |
download | docker-buildsys-cc49a8c9ca40eaf0dce444c3028f88de89f9578f.tar.gz |
Improve timeout situation drastically
-rw-r--r-- | Dockerfile | 3 | ||||
-rwxr-xr-x | spawner.sh | 9 |
2 files changed, 11 insertions, 1 deletions
@@ -91,9 +91,10 @@ RUN curl -L https://github.com/krallin/tini/releases/download/v0.18.0/tini-stati && chmod +x /usr/bin/tini ADD with_env /usr/local/bin +ADD spawner.sh /usr/local/bin WORKDIR ${HOME} EXPOSE 22 -ENTRYPOINT ["tini", "-g", "--", "timeout", "-sKILL", "45m"] +ENTRYPOINT ["tini", "-g", "--", "spawner.sh"] CMD ["/bin/bash"] diff --git a/spawner.sh b/spawner.sh new file mode 100755 index 0000000..7fd328b --- /dev/null +++ b/spawner.sh @@ -0,0 +1,9 @@ +#!/bin/bash +limit="${TIMEOUT:-45m}" +echo "This job will automatically terminate after: ${limit}" +timeout -sTERM ${limit} $@ +retval=$? +if [[ ${retval} == 124 ]]; then + echo "Job terminated: ${limit} time limit reached" +fi +exit ${retval} |