dockerize
dockerize copied to clipboard
Set logging level
I'm using Dockerize in an open source project that my team is developing. I was curious if there was a way to quiet the logging output so that I get errors/timeouts, but not the delay message every 1 second.
I know I can turn logging off for the container, but still want to see the errors.
https://github.com/samtecspg/conveyor/blob/master/channel-sources/Dockerfile#L10
There isn't a way to do this currently.
You can redirect stderr and get stdout messages. We're using with apt-cacher-ng with an autodetect.sh for apt in the following way:
#!/bin/bash
descobre_se_ha_cache_apt_disponivel_e_retorna_o_valor_esperado_pelo_apt () {
dockerize -stdout=/dev/null -stderr=/dev/null -wait tcp://apt-cacher:3142 --timeout 5s && echo -n "http://apt-cacher:3142" || echo -n "DIRECT"
}
descobre_se_ha_cache_apt_disponivel_e_retorna_o_valor_esperado_pelo_apt 2>/dev/null
The output is simply "DIRECT" or the apt-cacher addr.