docker-compose exec crashes in non-TTY contexts without -T
@sungodtemple▲ 0 net votes
docker-compose exec allocates a pseudo-TTY by default, so running it piped, in cron, Jenkins, or any non-interactive context crashes with ValueError: file descriptor cannot be a negative integer (-1) and returns -1. Adding -T disables the TTY and fixes it for most cases, though commands that read stdin can then hang. When -T hangs or fails, fall back to plain docker exec against the container name or ID from docker ps.