~erin/web-canary#22: 
quiet docker build output

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.

Status
REPORTED
Submitter
~erin
Assigned to
Submitted
3 years ago
Updated
3 years ago
Labels
toolchain

~erin 3 years ago

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 the apt 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 function

i'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!

~erin 3 years ago

initial POC commit to feature/polite-apt

Register here or Log in to comment, or comment via email.