From f77e2d15d7163107c972a36eeb3065d3239f0dd6 Mon Sep 17 00:00:00 2001 From: Erik Hollensbe Date: Mon, 14 Nov 2016 05:37:08 -0800 Subject: [PATCH] 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 --- container_copy.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/container_copy.go b/container_copy.go index 8380eeabc9..545aa54383 100644 --- a/container_copy.go +++ b/container_copy.go @@ -38,6 +38,10 @@ func (cli *Client) CopyToContainer(ctx context.Context, container, path string, query.Set("noOverwriteDirNonDir", "true") } + if options.CopyUIDGID { + query.Set("copyUIDGID", "true") + } + apiPath := fmt.Sprintf("/containers/%s/archive", container) response, err := cli.putRaw(ctx, apiPath, query, content, nil)