Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use sudo on aarch64 #32

Open
martin-g opened this issue Mar 26, 2020 · 1 comment
Open

Cannot use sudo on aarch64 #32

martin-g opened this issue Mar 26, 2020 · 1 comment

Comments

@martin-g
Copy link

Hi!

Thank you for this project! It is really helpful!

I've found an issue that prevents me to use Alpine Linux abuild tool on it.
abuild has to be executed by a non-root user with sudo but fails with Cannot lock database error while trying to install the dependencies with apk add.

I was able to minimize the problem to these steps:

  1. docker run -it --rm multiarch/alpine:aarch64-edge sh
  2. apk add sudo
  3. adduser xyz
  4. echo "xyz ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers
  5. su xyz
  6. sudo ls -la
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?

If I replace multiarch/alpine:aarch64-edge with alpine:3 at step 1 then everything is OK.

It looks similar to these issues:

  1. Cannot use sudo command inside Nvidia-Docker image moby/moby#36730 (comment)
  2. nosuid problem in foreign architecture builds alpinelinux/docker-abuild#47

Any idea how to work it around ?

@martin-g
Copy link
Author

I've just found a workaround!
multiarch/qemu-user-static#17 (comment)

docker run --rm --privileged multiarch/qemu-user-static:register --reset --credential yes

--credential yes is the key.

It would be nice to mention this in the README. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant