From 6007a95683d66cfb2809ea3d1c1f4ac709b7d32c Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 8 Mar 2025 21:10:23 -0500 Subject: [PATCH] fix: do not write VHOST file if the DOKKU_ROOT directory does not exist This can happen when building a new docker image as the DOKKU_ROOT directory isn't mounted yet. --- plugins/00_dokku-standard/install | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/00_dokku-standard/install b/plugins/00_dokku-standard/install index 3cd730920..ec0f94f4e 100755 --- a/plugins/00_dokku-standard/install +++ b/plugins/00_dokku-standard/install @@ -2,8 +2,10 @@ set -eo pipefail [[ $DOKKU_TRACE ]] && set -x -if [[ ! -f "$DOKKU_ROOT/VHOST" ]]; then - [[ $(dig +short "$(hostname -f)") ]] && hostname -f >"$DOKKU_ROOT/VHOST" +if [[ ! -f "$DOKKU_ROOT/VHOST" ]] && [[ -n "$(dig +short "$(hostname -f)")" ]]; then + if [[ -d "$DOKKU_ROOT" ]] || [[ -L "$DOKKU_ROOT" ]]; then + hostname -f >"$DOKKU_ROOT/VHOST" + fi fi dokku_path="$(command -v dokku)"