7

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.

vrms
  • 541

3 Answers3

5

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 \
  --name $DUMMY_SERVER_NAME \
  -e TERM=xterm \
  --expose=80 \
  debian /bin/bash -c "while [[ true ]]; do sleep 1; done"
1

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.

vrms
  • 541
0

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]