The documentation for docker run tells:
If you do not specify -a then Docker will attach to both stdout and
stderr . You can specify to which of the three standard streams
(STDIN, STDOUT, STDERR) you’d like to connect instead, as in:
$ docker run -a stdin -a stdout -i -t ubuntu /bin/bash
For interactive processes (like a shell), you must use -i -t together
in order to allocate a tty for the container process. -i -t is often
written -it as you’ll see in later examples. Specifying -t is
forbidden when the client is receiving its standard input from a pipe
[...]
So you should use -it instead of -i: the tty layer will have a chance to translate the terminal input from \r\n into \n for the target system:
$ docker run -it debian bash