From d43f3498274d9d4bbde0c1dc820a665953a56cc1 Mon Sep 17 00:00:00 2001 From: "Glenn Y. Rolland" Date: Mon, 6 Dec 2021 11:10:43 +0100 Subject: [PATCH] docker: test if _build directory exists before chown --- docker/entrypoint.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 7b5e455..1d39912 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -17,6 +17,8 @@ if ! grep -q "^[^:]*:[^:]*:$EXT_UID:" /etc/passwd ; then useradd -r -u "$EXT_UID" -g appuser appuser fi -chown -R "$EXT_UID:$EXT_GID" _build +if [ -d "_build" ]; then + chown -R "$EXT_UID:$EXT_GID" _build +fi exec gosu "$EXT_UID:$EXT_GID" make "$@"