img: img build: newuidmap: write to uid_map failed: Invalid argument

Hi, I’m trying to run img build on Ubuntu 16.04 (4.13.0-45-generic #50~16.04.1-Ubuntu) and getting the following error:

$ ./img build -d .
newuidmap: write to uid_map failed: Invalid argument
nsenter: failed to use newuidmap: No such file or directory
nsenter: failed to sync with parent: SYNC_USERMAP_ACK: got 255: No such file or directory
$ ./img version
img:
 version     : v0.4.7
 git hash    : e76c258
 go version  : go1.10.3
 go compiler : gc
 platform    : linux/amd64

newuidmap is installed, is it too old?

$ dpkg --list | grep uidmap
ii  uidmap                                                      1:4.2-3.1ubuntu5.3 

Anything else I can provide to debug?

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 17 (3 by maintainers)

Most upvoted comments

So I manually added the mapping for uid and gid, tried building again. It is still failing with the following error msg.

newuidmap: write to uid_map failed: Operation not permitted
nsenter: failed to use newuidmap: No such file or directory
nsenter: failed to sync with parent: SYNC_USERMAP_ACK: got 255: No such file or directory

For the record I’m having the same problem when running via docker on my computer (it’s an Arch, so I had to allow for unprivileged_userns_clone, see #148) and get the same error now:

$ docker run --rm -it --name img --volume $(pwd):/home/user/src:ro --workdir /home/user/src --cap-add SETGID --cap-add SETUID --security-opt apparmor=unconfined --security-opt seccomp=unconfined r.j3ss.co/img pull alpine
newuidmap: write to uid_map failed: Operation not permitted
nsenter: failed to use newuidmap: Invalid argument
nsenter: failed to sync with parent: SYNC_USERMAP_ACK: got 255: Invalid argument