mirror of
https://github.com/jessfraz/dockerfiles.git
synced 2024-11-27 04:16:45 +01:00
Merge pull request #56 from jpetazzo/dasht-only-if-tty
Only add `-t` if stdin is a tty
This commit is contained in:
commit
2cb39c1938
6
bashrc
6
bashrc
|
@ -32,7 +32,11 @@ command_not_found_handle () {
|
|||
fi
|
||||
done
|
||||
|
||||
docker run -ti -u $(whoami) -w "$HOME" \
|
||||
# Check if we are on a tty to decide whether to allocate one
|
||||
DASHT=
|
||||
tty -s && DASHT=-t
|
||||
|
||||
docker run $DASHT -i -u $(whoami) -w "$HOME" \
|
||||
$(env | cut -d= -f1 | awk '{print "-e", $1}') \
|
||||
$DEVICES $VOLUMES \
|
||||
-v /etc/passwd:/etc/passwd:ro \
|
||||
|
|
Loading…
Reference in New Issue
Block a user