Skip to content
Snippets Groups Projects
Commit 0d38d493 authored by Alex Sheplyakov's avatar Alex Sheplyakov Committed by Konstantin Pavlov
Browse files

Better ENV variables handling.

In case when env contain variables with newlines, the variables
substitution script fails, trying to use non-existent variables.

See https://github.com/nginxinc/docker-nginx/pull/560

 for more details.

Co-authored-by: default avatarTianon Gravi <admwiggin@gmail.com>
parent 4680ae8c
Branches
Tags
No related merge requests found
......@@ -16,7 +16,7 @@ auto_envsubst() {
local output_dir="${NGINX_ENVSUBST_OUTPUT_DIR:-/etc/nginx/conf.d}"
local template defined_envs relative_path output_path subdir
defined_envs=$(printf '${%s} ' $(env | cut -d= -f1))
defined_envs=$(printf '${%s} ' $(xargs -0n1 -a /proc/self/environ sh -c 'echo "$@" | grep -oEm1 "^[^=]+"' --));
[ -d "$template_dir" ] || return 0
if [ ! -w "$output_dir" ]; then
entrypoint_log "$ME: ERROR: $template_dir exists, but $output_dir is not writable"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment