From 8e680d02382ccb616f9675bb0c263fc84a5eedd2 Mon Sep 17 00:00:00 2001 From: "Daniel F. Dickinson" Date: Thu, 16 Jan 2020 10:27:43 -0500 Subject: [PATCH] Fix hostname leakage from build host Many hosts (including the docker host) set HOSTNAME in the environment, which means that unless the HOSTNAME is explicitly set in a 'config' that the resulting image hostname will be the build host's hostname. We fix that by unsetting HOSTNAME prior to reading the configs and applying defaults. Signed-off-by: Daniel F. Dickinson --- build.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build.sh b/build.sh index 9e78728..ac20816 100755 --- a/build.sh +++ b/build.sh @@ -125,6 +125,10 @@ fi BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" export BASE_DIR +# Make sure HOSTNAME doesn't leak in from host +unset HOSTNAME +export HOSTNAME + if [ -f config ]; then # shellcheck disable=SC1091 source config