I have a mysql container running in docker container, which is intentionally not accessible through any port, but is accessible to other docker container.
For example consider following mysql container
docker run --name test_db mysql
Now I want to run a dump file in that mysql that is present on my host machine.
cat mydumpfile.sql | docker exec -it test_db mysql --password=${MY_MYSQL_PASSWORD}
But I am getting following in response
the input device is not a TTY
How to pipe output from my host machine to docker container?
Please notice one thing, it is not about error, by removing -it or -i, I don't get error, but I am not able to pipe output to docker container.
The question is how to pipe any output from host to docker container.
Error "The input device is not a TTY" -- that doesn't solve the problem.