Merge pull request #5 from tonistiigi/tmux-optional

hack: make tmux optional for shell
pull/9/head
Tibor Vass 6 years ago committed by GitHub
commit c39345c42b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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

@ -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)
docker run -it --privileged --rm -e TMUX_ENTRYPOINT=$TMUX $(cat $iidfile)
Loading…
Cancel
Save