Docker: Running nano in docker container

Solution 1:

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)

Solution 2:

Run comand : export TERM=xterm

Solution 3:

You can add

ENV TERM xterm

to your Dockerfile if you will use the editor regularly. We have that setting in our base container, since we're constantly debugging things with vi/emacs.

Solution 4:

docker exec -it id_container bash
apt-get update
apt-get install nano
export TERM=xterm

Solution 5:

as $TERM was already set to xterm but still not working for me, here is a way that worked: docker exec -it [CONTAINER_ID] /bin/bash -c "export TERM=xterm; exec bash"