Open ouyangde opened 3 years ago
Found an issue to check if file is readable in library/alpine:3.14
: the file has read permission for everyone (checked) but the test returns an error code:
bash-5.1# [[ -r /etc/dehydrated/domains.txt ]]
bash-5.1# echo $?
1
bash-5.1# ls -alh /etc/dehydrated/
total 32K
drwxr-xr-x 1 root root 4.0K Jun 29 18:30 .
drwxr-xr-x 1 root root 4.0K Jun 29 18:20 ..
-rw-r--r-- 1 root root 96 Jun 29 18:30 domains.txt
Reverting to library/alpine:3.13
fixed the issue, for me.
bash-5.1# [[ -r domains.txt ]]
bash-5.1# echo $?
0
very annoying bug, I stumbled upon this one myself. Still present in the current version of alpine:3.14
Any suggestions on how to tackle or any WIP on this? going back to 3.13 might not be the smartest solution here.
This is related to faccessat2 syscall has been enabled in musl in alpine starting 3.14. Due to a bug in runc it fails if your kernel do not support faccessat2.
Short answer update runc to >= 1.0.0-rc93 or update kernel to 5.8 (upgrading kernel should work but i haven't tested it)
Detail in release note
https://wiki.alpinelinux.org/wiki/Release_Notes_for_Alpine_3.14.0#faccessat2
Bug in runc (fixed in 1.0.0-rc93 )
https://github.com/opencontainers/runc/issues/2151
This also seems to affect the executable test in Alpine 3.14:
$> docker run -it alpine:3.14 /bin/sh
/ # apk update && apk add bash
...
/ # bash
bash-5.1# if [ ! -x /bin/bash ]; then echo "I should not get printed!"; fi
I should not get printed!
bash-5.1#
Not sure whether this is worth a new issue here?
Same issue on alpine:3.15.0
and alpine:edge
.
Directory test also failed ( test -x /tmp
then echo $?
, got 1
)
And issue exists in alpine images 3.17.2, 3.17.3
Steps to reproduce:
Version to reproduce: (Result from docker inspect alpine:edge)