can we also use --credential=yes for binfmt generation?
Description:
When you use qemu-user-static and qemu-user-static-binfmt and you want to cross build on amd64 for aarch64 for example, many build tools rely on sudo for package installations, with our current binfmt you will get sudo: effective uid is not 0, is /usr/bin/sudo on a file system with the 'nosuid' option set or an NFS file system without root privileges?
Additional info:
- package version(s): 8.1.3
- config and/or log files:
- link to upstream bug report, if any: https://github.com/multiarch/qemu-user-static/issues/17
Steps to reproduce:
docker run --platform=linux/arm64/v8 --rm -it docker.io/library/alpine:3.18 sh
/ # apk add sudo
fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/main/aarch64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.18/community/aarch64/APKINDEX.tar.gz
(1/1) Installing sudo (1.9.13_p3-r2)
Executing busybox-1.36.1-r5.trigger
OK: 10 MiB in 16 packages
/ # adduser -D myuser
/ # echo "myuser ALL=(ALL) NOPASSWD:ALL" >/etc/sudoers.d/myuser
/ # su - myuser
edb13e36a682:~$ sudo apk update
sudo: effective uid is not 0, is /usr/bin/sudo on a file system with the 'nosuid' option set or an NFS file system without root privileges?
edb13e36a682:~$