Skip to content

Commit 8cec517

Browse files
authored
Merge pull request #185 from tonistiigi/xx-apk-lock
xx-apk: fix problem with writing lock in latest alpine
2 parents fa29281 + 1542147 commit 8cec517

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/xx-apk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@
33
set -e
44

55
if [ -z "$XX_APK_NOLOCK" ]; then
6+
# readlink -f in ash can not resolve symlinks from deep workdir
7+
cd /
68
if [ -L /var/lock ] && [ ! -e "$(readlink -f /var/lock)" ]; then
79
mkdir -p "$(readlink -f /var/lock)"
810
elif [ ! -d /var/lock ]; then
911
mkdir -p /var/lock
1012
fi
13+
cd -
1114
lock="/var/lock/xx-apk"
1215
exec 9>$lock
1316
flock -x 9

0 commit comments

Comments
 (0)