Skip to content

Commit d0101cb

Browse files
committed
try to build & run on podman via one more hack to resolv.conf parsing
- why the hell does nginx need a resolver config, again?
1 parent 2f55921 commit d0101cb

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

Diff for: Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# We start from my nginx fork which includes the proxy-connect module from tEngine
22
# Source is available at https://github.com/rpardini/nginx-proxy-connect-stable-alpine
33
# This is already multi-arch!
4-
ARG BASE_IMAGE="rpardini/nginx-proxy-connect-stable-alpine:nginx-1.18.0-alpine-3.12.1"
4+
ARG BASE_IMAGE="docker.io/rpardini/nginx-proxy-connect-stable-alpine:nginx-1.18.0-alpine-3.12.1"
55
# Could be "-debug"
66
ARG BASE_IMAGE_SUFFIX=""
77
FROM ${BASE_IMAGE}${BASE_IMAGE_SUFFIX}

Diff for: entrypoint.sh

+12-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
11
#! /bin/bash
22

3+
echo "Entrypoint starting."
4+
35
set -Eeuo pipefail
46
trap "echo TRAPed signal" HUP INT QUIT TERM
57

6-
#configure nginx DNS settings to match host, why must we do that nginx?
7-
export RESOLVERS=$(awk '$1 == "nameserver" {print ($2 ~ ":")? "["$2"]": $2}' ORS=' ' /etc/resolv.conf | sed 's/ *$//g')
8+
# configure nginx DNS settings to match host, why must we do that nginx?
9+
# this leads to a world of problems. ipv6 format being different, etc.
10+
# below is a collection of hacks contributed over the years.
11+
12+
echo "-- resolv.conf:"
13+
cat /etc/resolv.conf
14+
echo "-- end resolv"
15+
16+
# Podman adds a "%3" to the end of the last resolver? I don't get it. Strip it out.
17+
export RESOLVERS=$(cat /etc/resolv.conf | sed -e 's/%3//g' | awk '$1 == "nameserver" {print ($2 ~ ":")? "["$2"]": $2}' ORS=' ' | sed 's/ *$//g')
818
if [ "x$RESOLVERS" = "x" ]; then
919
echo "Warning: unable to determine DNS resolvers for nginx" >&2
1020
exit 66

0 commit comments

Comments
 (0)