-
Notifications
You must be signed in to change notification settings - Fork 2k
Convert explicit "export A=B" lines of Apache's envvars file into "${A:=B}" such that we can override them at runtime easily #282
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
Conversation
…A:=B}" such that we can override them at runtime easily Before: ```sh unset HOME if [ "${APACHE_CONFDIR##/etc/apache2-}" != "${APACHE_CONFDIR}" ] ; then SUFFIX="-${APACHE_CONFDIR##/etc/apache2-}" else SUFFIX= fi export APACHE_RUN_USER=www-data export APACHE_RUN_GROUP=www-data export APACHE_PID_FILE=/var/run/apache2/apache2$SUFFIX.pid export APACHE_RUN_DIR=/var/run/apache2$SUFFIX export APACHE_LOCK_DIR=/var/lock/apache2$SUFFIX export APACHE_LOG_DIR=/var/log/apache2$SUFFIX export LANG=C export LANG ``` After: ```sh unset HOME if [ "${APACHE_CONFDIR##/etc/apache2-}" != "${APACHE_CONFDIR}" ] ; then SUFFIX="-${APACHE_CONFDIR##/etc/apache2-}" else SUFFIX= fi : ${APACHE_RUN_USER:=www-data} export APACHE_RUN_USER : ${APACHE_RUN_GROUP:=www-data} export APACHE_RUN_GROUP : ${APACHE_PID_FILE:=/var/run/apache2/apache2$SUFFIX.pid} export APACHE_PID_FILE : ${APACHE_RUN_DIR:=/var/run/apache2$SUFFIX} export APACHE_RUN_DIR : ${APACHE_LOCK_DIR:=/var/lock/apache2$SUFFIX} export APACHE_LOCK_DIR : ${APACHE_LOG_DIR:=/var/log/apache2$SUFFIX} export APACHE_LOG_DIR : ${LANG:=C} export LANG export LANG ``` (minus comments)
The main thing I see this breaking is folks who are using |
This has fun implications for issues like #14 too. 😄 (To be clear, by "fun", I mean "likely fixes the issue".) |
👍, though I kind of wish something like document root was in there too, so we could solve some other issues. |
Yeah, I think that's something we could consider adding pretty easily as a "next step" following this, if we decide it makes sense. Should be pretty easy to implement. 👍 (I've just pushed a commit applying |
LGTM |
@tianon, I think #14 is about changing UID at runtime by environment variables. With this PR, we can only change apache user at build time and we need to extend image with creation of such user. So can you reopen #14 ? |
@Vampouille it used to be build-time only, but this PR makes it possible to set variables like |
- `elasticsearch`: 5.0.0-alpha5 (docker-library/elasticsearch#113) - `php`: `/etc/apache2/envvars` tweaks (docker-library/php#282), `--enable-ftp` (docker-library/php#287) - `piwik`: swap from merge commit to commit with substance (direct output of `generate-stackbrew-library.sh`) - `python`: templates (docker-library/python#139), fix `import dbm` (docker-library/python#140)
This is intended as something to think about and discuss first, which is why I've not run
update.sh
yet. 😄The intended use case is to allow for these pre-provided environment variables which are currently hard-coded and can only be changed by modifying this
envvars
file to be easily user-specifiable via-e
on thedocker run
command line.Before:
After:
(minus comments)
Fixes #14