Skip to content

Commit

Permalink
Merge pull request #185 from tonistiigi/xx-apk-lock
Browse files Browse the repository at this point in the history
xx-apk: fix problem with writing lock in latest alpine
  • Loading branch information
tonistiigi authored Dec 9, 2024
2 parents fa29281 + 1542147 commit 8cec517
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/xx-apk
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
set -e

if [ -z "$XX_APK_NOLOCK" ]; then
# readlink -f in ash can not resolve symlinks from deep workdir
cd /
if [ -L /var/lock ] && [ ! -e "$(readlink -f /var/lock)" ]; then
mkdir -p "$(readlink -f /var/lock)"
elif [ ! -d /var/lock ]; then
mkdir -p /var/lock
fi
cd -
lock="/var/lock/xx-apk"
exec 9>$lock
flock -x 9
Expand Down

0 comments on commit 8cec517

Please sign in to comment.