Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker: Running nano in docker container

Tags:

docker

I open an interactive shell into a docker container like so

sudo docker exec -t -i {container_name} bash

So far so good but trying to run nano results in:

Error opening terminal: unknown.

like image 768
Myles McDonnell Avatar asked Sep 25 '22 18:09

Myles McDonnell


1 Answers

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)
like image 199
Javier Cortejoso Avatar answered Oct 17 '22 00:10

Javier Cortejoso