Skip to content

Instantly share code, notes, and snippets.

@dlindahl
Created November 16, 2016 21:33
Show Gist options
  • Save dlindahl/57dca2309175a65eeb6f7f7a794333a4 to your computer and use it in GitHub Desktop.
Save dlindahl/57dca2309175a65eeb6f7f7a794333a4 to your computer and use it in GitHub Desktop.
ETA Docker blog post code
#!/bin/sh
socat -u UNIX-LISTEN:/dev/log,fork STDOUT |
stdbuf -o0 tr '\n<' '<\n' |
stdbuf -o0 paste -sd\\n - -|
sed -e'/^[0-9]\{1,\}>/!{$!H;1h;$!d'\
-e\} -e'x;y/\n</<\n/;s//<&/' \
-ew\ /dev/fd/1 &
FROM debian:jessie
RUN apt-get install socat
ENTRYPOINT [ "docker-entrypoint.sh" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment