Php: `docker-php-ext-install` should be quiet unless there are errors / warnings

Created on 26 Oct 2016  路  7Comments  路  Source: docker-library/php

Given the dockerfile:

FROM php:7-apache
RUN apt-get -qq update && apt-get -qq install libxml++2.6-dev > /dev/null
RUN docker-php-ext-install soap
COPY ./ /var/www/html

Running docker-php-ext-install soap spams the console. I want it to be as quite as possible and only to show errors and warnings.

Hence, I directed the output to /dev/null

RUN docker-php-ext-install soap > /dev/null

yet this also dumps debug information:

Step 3 : RUN docker-php-ext-install soap > /dev/null
 ---> Running in 5a05f4e3576d
+ cd /usr/src/php/ext/soap
+ phpize
+ ./configure
 ---> f506393f0161

I do want to keep the error and warning messages if they occure, yet those are none.

It would be nice to have quiet flag for which does that out of the box, or that the all messages that are not representing at least a warning should be written to stdout.

Most helpful comment

Thanks guys. Way too chatty.

# add silently...
RUN set -x
RUN docker-php-ext-install foo > /dev/null

All 7 comments

Oh, yeah a silent mode would be nice or preferably a verbose mode that turns it on. Or we could just remove the set -x in the configure script

with bash we could set BASH_XTRACEFD=1 to make the trace output on stdout but I couldn't find the equivalent (if it exists) for sh

this feature would be very nice.

Sorry for the delay!

I'd be +1 on removing the set -x from docker-php-ext-configure. :+1:

It seems not to be that simple. I just created #555 but I still get a huge output. I also tried to remove the RUN set -x; in the Dockerfiles with no effect.

Yes, removing set -x doesn't make these scripts quiet, but it prevents us from adding additional output, so for many extensions, doing something like RUN docker-php-ext-install foobar > /dev/null will be completely silent (maybe a few compiler warnings) unless there's an actual build failure (and then it'll include the error).

Thanks guys. Way too chatty.

# add silently...
RUN set -x
RUN docker-php-ext-install foo > /dev/null
Was this page helpful?
0 / 5 - 0 ratings

Related issues

dhoeric picture dhoeric  路  4Comments

sanjay-rakholiya picture sanjay-rakholiya  路  3Comments

ihorsamusenko picture ihorsamusenko  路  4Comments

cmath10 picture cmath10  路  3Comments

ktrzos picture ktrzos  路  3Comments