mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-17 20:34:51 +08:00
Add docker-entrypoint.sh
This commit is contained in:
parent
129041402d
commit
7cbc374278
1
.gitignore
vendored
1
.gitignore
vendored
@ -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
11
bin/docker-entrypoint.sh
Normal 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 "$@"
|
||||||
Loading…
x
Reference in New Issue
Block a user