Use double quotes in docker entrypoint to prevent word splitting

This commit is contained in:
Mitchell Allain 2023-08-13 14:36:55 -05:00
parent 250d530260
commit 0b2925709c

View File

@ -29,8 +29,8 @@ configure() {
echo "To reconfigure InvokeAI, delete the above file." echo "To reconfigure InvokeAI, delete the above file."
echo "======================================================================" echo "======================================================================"
else else
mkdir -p ${INVOKEAI_ROOT} mkdir -p "${INVOKEAI_ROOT}"
chown --recursive ${USER} ${INVOKEAI_ROOT} chown --recursive ${USER} "${INVOKEAI_ROOT}"
gosu ${USER} invokeai-configure --yes --default_only gosu ${USER} invokeai-configure --yes --default_only
fi fi
} }
@ -50,16 +50,16 @@ fi
if [[ -v "PUBLIC_KEY" ]] && [[ ! -d "${HOME}/.ssh" ]]; then if [[ -v "PUBLIC_KEY" ]] && [[ ! -d "${HOME}/.ssh" ]]; then
apt-get update apt-get update
apt-get install -y openssh-server apt-get install -y openssh-server
pushd $HOME pushd "$HOME"
mkdir -p .ssh mkdir -p .ssh
echo ${PUBLIC_KEY} > .ssh/authorized_keys echo "${PUBLIC_KEY}" > .ssh/authorized_keys
chmod -R 700 .ssh chmod -R 700 .ssh
popd popd
service ssh start service ssh start
fi fi
cd ${INVOKEAI_ROOT} cd "${INVOKEAI_ROOT}"
# Run the CMD as the Container User (not root). # Run the CMD as the Container User (not root).
exec gosu ${USER} "$@" exec gosu ${USER} "$@"