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 <cshored@thecshore.com>
pull/376/head
Daniel F. Dickinson 2020-01-16 10:27:43 -05:00
parent f8f3d6fe93
commit 8e680d0238
1 changed files with 4 additions and 0 deletions

View File

@ -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