apt
produces a metric fuckton of output due to all the packages we're installing. there has to be a way to quiet this a bit without completely suppressing all actions.
the option
Dpkg::Use-Pty
can suppress all output, but i haven't been able to find a way to simply reduce output.the hack i came up isn't ideal..
- using that
apt
option and forking theapt
process- reading
/var/log/dpkg.log
to stdout, which is much less chatty- waiting for
apt
to exit, and stopping the log read- bubbling up the exit code of
apt
to terminate build on error- encapsulating all this in a shell function
- writing shell script wrappers for each block in the
Dockerfile
that use said functioni'm not really a fan of doing this because it moves so much of the build instructions out of the
Dockerfile
... i suppose i can make up for that with comments.. bleh!
initial POC commit to
feature/polite-apt