docker cp reports error about Lchown but copies file anyway

122 views Asked by At

I am running on Ubuntu 22.04 with docker version 24.0.7 running in rootless mode. As part of standing up a new container I will copy files into it using the command docker cp. Previously I worked with RHEL and podman and this process worked fine.

This is error I am seeing:

$ docker cp /home/refriedjello/test 21d77c659def:/root/test -q
Error response from daemon: failed to Lchown "/root/test" for UID 999182, GID 701 (try increasing the number of subordinate IDs in /etc/subuid and /etc/subgid): lchown /root/test: invalid argument

However, the files are being copied into the container, and the files end up owned by the container user (root). So the command is ultimately successful, insofar as my needs are concerned.

Here is output related to my username and the UID files:

$ id -u
999182
$ whoami
refriedjello
$ grep ^$(whoami): /etc/subuid
refriedjello:296608:65536
$ grep ^$(whoami): /etc/subgid
refriedjello:296608:65536

Edit: If I supply the archive -a flag the error does not occur and the file is still copied into the container, so I will just modify my process to use that.

0

There are 0 answers