Does the docker cp handle the uid/guid for API and cp ?

Solution Verified - Updated -

Issue

Non-root user inside container does not have permission to save data on docker volume. Wit the following scenario:

- Create new image and switch to new user
- Create container with docker volume (in R/W mode)
- Run the container and try to save data on attached volume

it fails with

touch: cannot touch '/test/test': Permission denied

Does the docker handle the uid/guid of the files which are copy to the volumes ?

Environment

  • Red Hat Enterprise Linux 7.x
  • docker

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.