I am running an ubuntu 14.04 inside a docker container. My image is build from the official ubuntu:14.04 image) The Docker file is almost identical with this https://github.com/pfy/erpnext/blob/master/Dockerfile (just changed FROM debian:wheezy >>> FROM ubuntu:14.04).

ERPNext is being installed using this script https://raw.githubusercontent.com/frappe/bench/master/install_scripts/setup_frappe.sh).

The build and run instruction to be found here https://raw.githubusercontent.com/pfy/erpnext/master/README.md

Somehow it is working but the terminal/console seems not to be fully functional.

i.e. I get a "TERM environment variable not set" when I try to clearthe screen. I found some other posts with the same or similar error message but the context is always different, so I can't get anything from the solutions offered.

I guess the docker ubuntu images might be used pretty frequent, so maybe someone has encountered and solved this issue.

  • TERM should be set by the terminal emulator. Which terminal emulator are you using? – Gunnar Hjalmarsson Feb 18 '16 at 12:28
  • honestly. no idea which terminal emulator I am using. I didn't install any and I don't think the scripts that ran to install ERPNext install any. So it should be what is 'shipped' with the ubuntu:14.04 docker image. – vrms Feb 18 '16 at 22:25
  • I found out that this problem doesn't exist when running a container from the fresh ubuntu:14.04 image. So it seems it occurs somehow through the ERPNext installation. I can't identify anything responsible for such in the scripts that are being run. I don't understand too much of them though I should add. – vrms Feb 18 '16 at 22:28
  • just a thought: there is no Desktop environment, so is there a terminal emulator involved at all ? – vrms Feb 18 '16 at 22:47
  • It was you who mentioned "terminal/concole". The default terminal eliminator in Ubuntu is gnome-terminal and the default user shell is bash. Without really understanding the implications of the docker, a workaround might possibly be to add export TERM=xterm at the top of .bashrc. – Gunnar Hjalmarsson Feb 18 '16 at 23:58

Short of having to edit a config after launching the container, instead you can just define the missing environment variable when you run the debian based container

-e TERM=xterm 

as in this example

export DUMMY_SERVER_NAME=itswednesday

docker run \
  -d \
  -e TERM=xterm \
  --expose=80 \
  debian /bin/bash -c "while [[ true ]]; do sleep 1; done"

thanks to the comments from Gunnar Hjalmarsson this is what seems to solve the issue

docker start [container]
docker exec -it [container] bash
vim /etc/bash.bashrc

adding export TERM=xterm to the top of the file, stopping/restarting my container ...

e voila! ... the terminal seems to behave 'normal' (which I tested by using the clear command which didn't work before and now does)

thanks again and sorry for introducing misleading terms (terminal/console) in my original post.


This will be fixed in Docker 1.13 via this pull request that was recently merged. Until you run that version, you can run exec commands like so, to avoid this problem:

docker exec --tty [container] env TERM=xterm [command-to-run]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.