Closed mike2307 closed 5 years ago
What is your UID, GID and /etc/sub[ug]id ?
@AkihiroSuda UID is 1310810133 (originating from a domain) GID is 1310800513 (originating from a domain) /etc/subuid for the corresponding user is xxx:165536:65536 (have been added manually) /etc/subgid for the corresponding user is xxx:165536:65536 (have been added manually)
You need more than 1310810133 subuids (currently you only have 65536) because docker cp
wants to chown the file to 1310810133.
Or use tar cf - somefile | docker exec foo tar xf -
instead.
So what would be a working configuration?
I changed my /etc/sub[ug]id to xxx:165536:1320000000
Now docker won't start:
[rootlesskit:parent] error: failed to setup UID/GID map: newuidmap 6332 [0 1310810133 1 1 165536 1320000000] failed: newuidmap: write to uid_map failed: Invalid argument
: exit status 1
Am I exceeding some limits here?
The UID limit should be 4G on Linux, but newuidmap
might have 2G limit, not sure
Just for the case someone, having a very high UID/GID as well, stumbles across that issue...
For my UID 1310810133/GID 1310800513 this worked:
$ cat /etc/subuid
xxxxxx:1320000000:1320000000
$ cat /etc/subgid
xxxxxx:1320000000:1320000000
In addition, a high UID will also cause https://github.com/moby/moby/issues/39608. The workaround is described here: https://github.com/moby/moby/issues/39608#issuecomment-529856990
The problem is still present and the workaround mentionned by @mike2307 or @AkihiroSuda (adding a very large range) is not applicable on environments with a lot of users.
In my case, users have a very high UID (> 1 000 000 0000) that I cannot change. Using docker rootless, users cannot execute docker cp with one of their files as their uid is huge. I cannot map those users on subuid without overlap as I must give them a range including their uid to make it works.
Note that docker pull is not working either if the image contains a file with an owner uid outside of the range. The user gets the same error (lchown invalid argument)
Is there any other way to correct this ?
Running rootless containers without subuid is being experimented in https://github.com/rootless-containers/subuidless , but not ready for actual use yet
Thanks for the answer. It means wanting users with high uid rootless setup is a dead end until subuidless is fully implemented ?
Description I'm experimenting with docker in rootless mode, using script https://get.docker.com/rootless. Starting containers works fine but a docker cp command fails always.
Steps to reproduce the issue:
$ docker run --rm -d traefik
$ touch my_file
$ docker cp my_file dazzling_williamson:/tmp/
Describe the results you received: Error response from daemon: Error processing tar file(exit status 1): lchown /tmp/my_file: invalid argument
Describe the results you expected: File is being copied without errors.
Additional information you deem important (e.g. issue happens only occasionally): Always reproducible.
Output of
docker version
:Output of
docker info
:Additional environment details (AWS, VirtualBox, physical, etc.):