I can reproduce this with this Dockerfile:
RUN yum -y install screen && rm -rf /var/cache/yum
CMD screen -S session1 sleep 99999
when I run it with docker run <imageID> I get Must be connected to a terminal.
Screen needs a terminal (tty) to function. The solution is to add -tid to the run flags, from the help:
Does your user account eric have the permission to use /dev/ttyUSB0? To find out, please run ls -l /dev/ttyUSB0. The output might look like this:
$ ls -l /dev/ttyUSB0
crw-rw----+ 1 root dialout 166, 0 Jul 9 08:55 /dev/ttyUSB0
The characters at the left-most column are the file type and permissions information:
The first character is c, indicating a ...