You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
My docker daemon has the userns-remap feature enabled.
When I run command docker cp -a my-container:/path/to/dir - > /tmp/copy.tar, files and directories within generated archive have wrong UID/GID (for example, files owned by user 1000 in container will have owner 166536). It seems UIDs/GIDs considered when creating tar archive are the host ids and not the container ones we can see from inside container.
However, when I run docker cp -a - my-container:/tmp/ < /tmp/copy.tar to copy directory from archive to container, it fails with an error like below :
Error response from daemon: Error processing tar file(exit status 1): Container ID 166536 cannot be mapped to a host ID
It seems to consider UIDs/GIDs from given archive as Container IDs and not host IDs, and so it fails because there are only 65536 sub-uids/sub-gids allocated for user dockremap.
Steps to reproduce the issue:
1 Configuration on host with userns-remap feature enabled
Copy directory /usr/share/elasticsearch/data from container to an archive file
user@ubuntu:~$ docker cp -a elasticsearch:/usr/share/elasticsearch/data/ - > ./backup.tar
Extract directory data from archive to /tmp in container
user@ubuntu:~$ docker cp -a - elasticsearch:/tmp/ < ./backup.tar
Error response from daemon: Error processing tar file(exit status 1): Container ID 166536 cannot be mapped to a host ID
Describe the results you received:
In generated archive, UIDs/GIDs are Host IDs
Describe the results you expected:
In generated archive, UIDs/GIDs set for files/directories should be Container IDs. In example above, directory nodes should have uid 1000 as owner and not 166536.
Additional information you deem important (e.g. issue happens only occasionally):
Description
My docker daemon has the userns-remap feature enabled.
When I run command
docker cp -a my-container:/path/to/dir - > /tmp/copy.tar
, files and directories within generated archive have wrong UID/GID (for example, files owned by user 1000 in container will have owner 166536). It seems UIDs/GIDs considered when creating tar archive are the host ids and not the container ones we can see from inside container.However, when I run
docker cp -a - my-container:/tmp/ < /tmp/copy.tar
to copy directory from archive to container, it fails with an error like below :It seems to consider UIDs/GIDs from given archive as Container IDs and not host IDs, and so it fails because there are only 65536 sub-uids/sub-gids allocated for user dockremap.
Steps to reproduce the issue:
1 Configuration on host with userns-remap feature enabled
Stat on directory nodes from archive content
Describe the results you received:
In generated archive, UIDs/GIDs are Host IDs
Describe the results you expected:
In generated archive, UIDs/GIDs set for files/directories should be Container IDs. In example above, directory nodes should have uid 1000 as owner and not 166536.
Additional information you deem important (e.g. issue happens only occasionally):
Output of
docker version
:Output of
docker info
:Additional environment details (AWS, VirtualBox, physical, etc.):
The text was updated successfully, but these errors were encountered: