I think this can be related with Docker Issue #9299.
There are some workarounds commented in that issue:
- Run the container allocating a pseudo-TTY (option
-t). - Export environment variable $TERM=xterm in the container’s process run in exec (i.e.:
export TERM=xterm)