diff --git a/hack/demo-env/entrypoint.sh b/hack/demo-env/entrypoint.sh index e2effa50..e4714bea 100755 --- a/hack/demo-env/entrypoint.sh +++ b/hack/demo-env/entrypoint.sh @@ -1,8 +1,17 @@ #!/bin/sh -tmux new -s demo -d -tmux new-window 'dockerd -s overlay2 -D' -tmux new-window -tmux a -t demo +dockerdCmd="dockerd -s overlay2 -D" + +if [ -n "$TMUX_ENTRYPOINT" ]; then + tmux new -s demo -d + tmux new-window "$dockerdCmd" + tmux new-window + tmux a -t demo +else + ( $dockerdCmd 2>/var/log/dockerd.log & ) + exec sh +fi + + diff --git a/hack/shell b/hack/shell index 5fcd0bfa..95cba7d5 100755 --- a/hack/shell +++ b/hack/shell @@ -2,11 +2,13 @@ set -e +: ${TMUX=} + function clean { docker rmi $(cat $iidfile) } iidfile=$(mktemp -t docker-iidfile.XXXXXXXXXX) -docker build --iidfile $iidfile --target demo-env . +DOCKER_BUILDKIT=1 docker build --iidfile $iidfile --target demo-env . trap clean EXIT -docker run -it --privileged --rm $(cat $iidfile) \ No newline at end of file +docker run -it --privileged --rm -e TMUX_ENTRYPOINT=$TMUX $(cat $iidfile) \ No newline at end of file