Y
Y
youngmysteriouslight2019-05-21 14:52:00
bash
youngmysteriouslight, 2019-05-21 14:52:00

How to simulate a TTY during the build phase of a Docker image?

When preparing the image, you must run a third-party console program.
An error message occurs.

stty: 'standard input': Inappropriate ioctl for device

I think this is due to the fact that somewhere in this program is done stty -aor something like that.
I will say right away that if you call the program in the container (docker run), everything is ok.
Here is a minimal script that reproduces the error. It is called by the RUN command in the dockerfile. Ubuntu main image: 18.04.
#mknod -m 660 /dev/ttyS0 c 4 64
#chown root:tty /dev/ttyS0
#setsid sh -c 'exec stty -a <> /dev/tty >&0 2>&1'
#echo '======'

stty -a

the commented lines are my attempts to create a pseudo-terminal.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question