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>
This commit is contained in:
parent
f8f3d6fe93
commit
8e680d0238
4
build.sh
4
build.sh
|
@ -125,6 +125,10 @@ fi
|
||||||
BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
export BASE_DIR
|
export BASE_DIR
|
||||||
|
|
||||||
|
# Make sure HOSTNAME doesn't leak in from host
|
||||||
|
unset HOSTNAME
|
||||||
|
export HOSTNAME
|
||||||
|
|
||||||
if [ -f config ]; then
|
if [ -f config ]; then
|
||||||
# shellcheck disable=SC1091
|
# shellcheck disable=SC1091
|
||||||
source config
|
source config
|
||||||
|
|
Loading…
Reference in New Issue
Block a user