Skip to content

Commit 7cbc374

Browse files
committed
Add docker-entrypoint.sh
1 parent 1290414 commit 7cbc374

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ packlib_files.txt
3434
/bin/*
3535
!/bin/spc*
3636
!/bin/setup-runtime*
37+
!/bin/docker-entrypoint.sh
3738

3839
# exclude windows build tools
3940
/php-sdk-binary-tools/

bin/docker-entrypoint.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
TARGET_DIR="/app/pkgroot/$(uname -m)-linux"
4+
BACKUP_DIR="/app/pkgroot-private"
5+
# copy private pkgroot to pkgroot if pkgroot is empty
6+
if [ ! -d "$TARGET_DIR" ] || [ -z "$(ls -A "$TARGET_DIR")" ]; then
7+
echo "* Copying private pkgroot to pkgroot ..."
8+
rm -rf "$TARGET_DIR"
9+
cp -r "$BACKUP_DIR" "$TARGET_DIR"
10+
fi
11+
exec "$@"

0 commit comments

Comments
 (0)