From 4313578d8ea2da7d7812997653a070b1baff257d Mon Sep 17 00:00:00 2001 From: Eugene Brodsky Date: Mon, 24 Jun 2024 16:57:43 -0400 Subject: [PATCH] fix(docker): ensure 'chown' does not break on read-only fs; fixes #6264 --- docker/docker-entrypoint.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docker/docker-entrypoint.sh b/docker/docker-entrypoint.sh index 7fb52f3af9..686bd9630f 100755 --- a/docker/docker-entrypoint.sh +++ b/docker/docker-entrypoint.sh @@ -23,18 +23,18 @@ usermod -u ${USER_ID} ${USER} 1>/dev/null # but it is useful to have the full SSH server e.g. on Runpod. # (use SCP to copy files to/from the image, etc) if [[ -v "PUBLIC_KEY" ]] && [[ ! -d "${HOME}/.ssh" ]]; then - apt-get update - apt-get install -y openssh-server - pushd "$HOME" - mkdir -p .ssh - echo "${PUBLIC_KEY}" > .ssh/authorized_keys - chmod -R 700 .ssh - popd - service ssh start + apt-get update + apt-get install -y openssh-server + pushd "$HOME" + mkdir -p .ssh + echo "${PUBLIC_KEY}" >.ssh/authorized_keys + chmod -R 700 .ssh + popd + service ssh start fi mkdir -p "${INVOKEAI_ROOT}" -chown --recursive ${USER} "${INVOKEAI_ROOT}" +chown --recursive ${USER} "${INVOKEAI_ROOT}" || true cd "${INVOKEAI_ROOT}" # Run the CMD as the Container User (not root).