Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion 6-next/alpine3.23/docker-entrypoint.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion 6-next/bookworm/docker-entrypoint.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion docker-entrypoint-next.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ fi

# allow the container to be started with `--user`
if [ -n "$isGhost" ] && [ "$(id -u)" = '0' ]; then
find "$GHOST_CONTENT" \! -user ghost -exec chown ghost '{}' +
# -h: ghost:6 seeded its bundled themes as symlinks into /var/lib/ghost, which does not
# exist here. Without it chown follows them, fails on the missing target, and set -e aborts.
find "$GHOST_CONTENT" \! -user ghost -exec chown -h ghost '{}' +
exec gosu ghost "$0" "$@"
fi

Expand All @@ -87,6 +89,12 @@ if [ -n "$isGhost" ]; then
src="${src%/}"
target="$GHOST_CONTENT/${src#$baseDir/}"
mkdir -p "$(dirname "$target")"
# those same dangling theme symlinks are not "-e", so the seed below would run and tar
# would extract *through* the symlink instead of replacing it. Drop them first. Guarded on
# broken-only so a user's own valid symlinked theme is left alone.
if [ -L "$target" ] && [ ! -e "$target" ]; then
rm -f "$target"
fi
if [ ! -e "$target" ]; then
tar -cC "$(dirname "$src")" "$(basename "$src")" | tar -xC "$(dirname "$target")"
fi
Expand Down
Loading