16

I am using EC2 UserData to bootstrap the instance.

TRacking log of bootstrap execution /var/log/cloud-init-output.log, I found that the script was stopped at :

+ docker-compose exec web python /var/www/flask/app/db_fixtures.py
the input device is not a TTY

It seems like this command it's running in interactive mode, but why ? and how to force noninteractive mode for this command (docker-compose exec) ?

Abdennour TOUMI
  • 87,526
  • 38
  • 249
  • 254

1 Answers1

44

Citing from the docker-compose exec docs:

Commands are by default allocating a TTY, so you can use a command such as docker-compose exec web sh to get an interactive prompt.

To disable this behavior, you can either the -T flag to disable pseudo-tty allocation:

docker-compose exec -T web python /var/www/flask/app/db_fixtures.py

Or set the COMPOSE_INTERACTIVE_NO_CLI environment variable to 1 before running docker-compose exec:

export COMPOSE_INTERACTIVE_NO_CLI=1
rusheb
  • 1,004
  • 9
  • 15
Yuankun
  • 6,875
  • 3
  • 32
  • 34