Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add env "BIND_LOG_STDERR" to control log #113

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ When the container is started the [Webmin](http://www.webmin.com/) service is al

The launch of Webmin can be disabled by adding `--env WEBMIN_ENABLED=false` to the `docker run` command. Note that the `ROOT_PASSWORD` parameter has no effect when the launch of Webmin is disabled.

To allow bind log to file by adding `--env BIND_LOG_STDERR=false` to the `docker run` command. That make bind not force all log to STDERR by using -f instead of -g to start the named process.

Read the blog post [Deploying a DNS Server using Docker](http://www.damagehead.com/blog/2015/04/28/deploying-a-dns-server-using-docker/) for an example use case.

## Command-line arguments
Expand Down
6 changes: 5 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,11 @@ if [[ -z ${1} ]]; then
fi

echo "Starting named..."
exec "$(command -v named)" -u ${BIND_USER} -g ${EXTRA_ARGS}
if [ "${BIND_LOG_STDERR:-true}" == "true" ]; then
exec "$(command -v named)" -u ${BIND_USER} -g ${EXTRA_ARGS}
else
exec "$(command -v named)" -u ${BIND_USER} -f ${EXTRA_ARGS}
fi
else
exec "$@"
fi