docker-images/nginx/15-local-resolvers.sh
ThetaDev d9e41578ef
Some checks failed
Build and push NGINX image / build (push) Failing after 2m32s
feat: add nginx image
2024-04-14 02:05:21 +02:00

12 lines
336 B
Bash
Executable file

#!/bin/sh
# vim:sw=2:ts=2:sts=2:et
set -eu
LC_ALL=C
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
[ "${NGINX_ENTRYPOINT_LOCAL_RESOLVERS:-}" ] || return 0
NGINX_LOCAL_RESOLVERS=$(awk 'BEGIN{ORS=" "} $1=="nameserver" {if ($2 ~ ":") {print "["$2"]"} else {print $2}}' /etc/resolv.conf)
export NGINX_LOCAL_RESOLVERS