mirror of https://github.com/docker/cli.git
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:
parent
4dcceaf70e
commit
f77e2d15d7
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue