fommil
fommil

Reputation: 5875

dumb terminal in non-interactive docker

I have a CI script that is run in a non-interactive docker container. One of the applications I use (emacs in batch mode) expects a TTY, even though it is never going to read from it.

In interactive mode, I can pipe /dev/tty to the application, but in non-interactive mode the device doesn't even exist!

How can I create a fake terminal in a non-interactive docker container?

BTW, I do not have control over the CI runner (drone) which starts the script... so I cannot add -i or -t

Running ls -R /dev gives

/dev:
fd
full
fuse
kcore
mqueue
null
ptmx
pts
random
shm
stderr
stdin
stdout
tty
urandom
zero

/dev/mqueue:

/dev/pts:
ptmx

/dev/shm:

Upvotes: 1

Views: 399

Answers (1)

Alex D'Andrea
Alex D'Andrea

Reputation: 23

Try to wrap the invocation of your script in a script (literally) invocation. There's a similar problem when su'ing to another user, and then accessing a screen session.

$ script /dev/null
$ emacs ...
$ exit

See also https://serverfault.com/a/116830

Upvotes: 1

Related Questions