Add docker-entrypoint.sh

This commit is contained in:
crazywhalecc 2025-09-05 11:04:42 +08:00
parent 129041402d
commit 7cbc374278
No known key found for this signature in database
GPG Key ID: 1F4BDD59391F2680
2 changed files with 12 additions and 0 deletions

1
.gitignore vendored
View File

@ -34,6 +34,7 @@ packlib_files.txt
/bin/* /bin/*
!/bin/spc* !/bin/spc*
!/bin/setup-runtime* !/bin/setup-runtime*
!/bin/docker-entrypoint.sh
# exclude windows build tools # exclude windows build tools
/php-sdk-binary-tools/ /php-sdk-binary-tools/

11
bin/docker-entrypoint.sh Normal file
View File

@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -e
TARGET_DIR="/app/pkgroot/$(uname -m)-linux"
BACKUP_DIR="/app/pkgroot-private"
# copy private pkgroot to pkgroot if pkgroot is empty
if [ ! -d "$TARGET_DIR" ] || [ -z "$(ls -A "$TARGET_DIR")" ]; then
echo "* Copying private pkgroot to pkgroot ..."
rm -rf "$TARGET_DIR"
cp -r "$BACKUP_DIR" "$TARGET_DIR"
fi
exec "$@"