diff --git a/release/Dockerfile b/release/Dockerfile index d369a4dc..bca942f1 100644 --- a/release/Dockerfile +++ b/release/Dockerfile @@ -42,6 +42,11 @@ yum-utils \ ADD * /usr/local/bin/ +# HACK: Working around Node.js screwing around with stdio +ENV NODE_PATH /usr/bin/node.real +RUN mv /usr/bin/node /usr/bin/node.real +ADD node-stdio-wrapper /usr/bin/node + VOLUME /home/user /build WORKDIR /build USER user diff --git a/release/node-stdio-wrapper b/release/node-stdio-wrapper new file mode 100755 index 00000000..9a293faf --- /dev/null +++ b/release/node-stdio-wrapper @@ -0,0 +1,17 @@ +#!/bin/sh + +# This is certified, A-grade, high quality turd polish. Node leaves +# stdio file descriptors in non-blocking mode when exiting. This has +# been reported, fixed, unfixed, ad nauseum. +# +# https://github.com/nodejs/node/issues/14752 +# https://github.com/nodejs/node/pull/17737 +# https://github.com/nodejs/node/pull/20592 +# https://github.com/nodejs/node/pull/21257 +# +# It's starting to fester. + +OUT=$(/usr/bin/node.real "$@" 2>&1