aureliojargas / clitest

Command Line Tester
MIT License
143 stars 12 forks source link

Output colors not available when running from Docker image #24

Closed aureliojargas closed 4 years ago

aureliojargas commented 8 years ago

We have colors when running non-Docker and when running inside Docker in an interactive session:

$ ./clitest -L -t 1 test.md
#1  test -f ./clitest; echo $?

$ docker run -it aureliojargas/clitest sh 
/ # cd /app && ./clitest -L -t 1 test.md
#1  test -f ./clitest; echo $?

But no color when running non-interactive:

$ docker run aureliojargas/clitest sh -c 'cd /app && ./clitest -L -t 1 test.md'
#1  OK  test -f ./clitest; echo $?

image

aureliojargas commented 4 years ago

You must use docker run -t to make sure Docker can allocate a pseudo-TTY and show colors.

aureliojargas commented 4 years ago

Closing this one, since now it's properly documented in the README-docker.md file.