Use non interactive flags in scripts

This is part of the Semicolon&Sons Code Diary - consisting of lessons learned on the job. You're in the bash category.

Last Updated: 2024-11-23

I had a docker script with a RUN directive apt-get install git that just stalled.

This issue was that it was awaiting y/n responses about how whether I was willing to install given that it would use up X-mb in space.

Lesson:

Whenever scripting a build or deploy process or docker container, use non-interactive versions of the commands (e.g. apt-get install -y git) otherwise it will stall forever or fail.