Compose: docker-compose up prints out "stty: standard input: Inappropriate ioctl for device"

Created on 16 Aug 2015  Â·  14Comments  Â·  Source: docker/compose

I have created a docker image using ubuntu trusty as the base.
The image is configured to run a Ruby application locally using the Ruby web server Thin.

Whenever I run docker-compose up I get the message in the subject constantly printing out along with stdout from the Ruby process.

This does not happen when I run a container from the save image using 'docker run'

Anyone got any ideas to fix this?

arecli kincleanup

Most helpful comment

Ah I am silly it is due to the default mapped on-the-fly commands, if you run rerun --background app.rb it will disable the on-the-fly commands and this issue goes away!

All 14 comments

Please provide the full command you're using for docker run and the docker-compose.yml config.

If you're using -t to docker run, and not using tty: true, that might cause it.

Docker run command:
_docker run -p 9292:9292 image_name_

Docker-compose:
web:
build: .
ports:

  • "9292:9292"
    volumes:
  • .:/usr/share/web

I'm happy to provide my docker file too if that helps

Any update on this?

I have a similar message in the log when calling docker-compose from the upstart script. However it doesn't happen when same command is called manually on command line.

The issue can be reproduced by calling docker-compose ps with a standard input which is not a terminal:

➜  landscape git:(robot-fix) ✗ docker-compose --version
docker-compose version: 1.3.1
CPython version: 2.7.9
OpenSSL version: OpenSSL 1.0.1e 11 Feb 2013
➜  landscape git:(robot-fix) ✗ docker-compose ps < /dev/null
stty: standard input: Inappropriate ioctl for device
      Name               Command          State     Ports
---------------------------------------------------------

It seems to be the fault of the cli.formatter.get_tty_width function, which doesn't suppress the standard error output of stty.

This is a pain when using docker-compose in Jenkins jobs

I am seeing this too running my ruby apps in a container using rerun, it only seems to spit out this message constantly when I am using rerun, running the sinatra app with ruby app.rb does not exhibit this behavior.

To get around it at the moment I am running docker-compose run web and it then does not spit out this message constantly.

Ah I am silly it is due to the default mapped on-the-fly commands, if you run rerun --background app.rb it will disable the on-the-fly commands and this issue goes away!

Still does not work in latest version of docker-compose (1.7.0)

@xiaodong-xie there is no -T in "docker-compose up". Also not on "docker-compose ps" I might add.
It is really unpleasant to make docker-compose work in shell scripts that way because you have to swallow all error messages.

Hmmm I'm still seeing this.

docker-compose version 1.23.2, build 1110ad01

Fix version was meant to be 1.12.0.

Thoughts?

Adding tty: true solved this issue for me.

When I run rerun in a docker container, it periodically outputs:

stty: standard input: Not a tty

That happens because by default docker-compose doesn't allocate a tty, and rerun tries to access one (stty). Adding tty: true only makes stty not complain. If you also want to be able to docker attach to the container and send some commands later, you need to add stdin_open: true as well. If you don't need that, it makes much more sense to run rerun with the --background switch. That affects 2 things:

  1. It doesn't start a thread to wait for user commands.
  2. Notifications are run in background (or most likely, not run at all, unless you make that possible).
Was this page helpful?
0 / 5 - 0 ratings