daemon/archive.go: Fix copy routines to preserve UID.

This changes the long-standing bug of copy operations not preserving the
UID/GID information after the files arrive to the container.

Signed-off-by: Erik Hollensbe <github@hollensbe.org>
This commit is contained in:
Erik Hollensbe 2016-11-14 05:37:08 -08:00
parent 4dcceaf70e
commit f77e2d15d7
1 changed files with 4 additions and 0 deletions

View File

@ -38,6 +38,10 @@ func (cli *Client) CopyToContainer(ctx context.Context, container, path string,
query.Set("noOverwriteDirNonDir", "true") query.Set("noOverwriteDirNonDir", "true")
} }
if options.CopyUIDGID {
query.Set("copyUIDGID", "true")
}
apiPath := fmt.Sprintf("/containers/%s/archive", container) apiPath := fmt.Sprintf("/containers/%s/archive", container)
response, err := cli.putRaw(ctx, apiPath, query, content, nil) response, err := cli.putRaw(ctx, apiPath, query, content, nil)