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, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content