main: set CopyUIDGID: true for copy to container (#428)

This ensures that uploaded files "inherit" the owner that is the USER
listed in the image definition.
This commit is contained in:
Paul Jolly
2020-10-06 14:37:55 +01:00
committed by GitHub
parent 1e0eb1f329
commit ed72c5a0b8

View File

@@ -229,7 +229,7 @@ func (d *docker) CopyToContainer(containerName, destination, fileName string, co
if err := t.Close(); err != nil { if err := t.Close(); err != nil {
return err return err
} }
return d.c.CopyToContainer(context.Background(), containerName, destination, &buf, types.CopyToContainerOptions{AllowOverwriteDirWithFile: true}) return d.c.CopyToContainer(context.Background(), containerName, destination, &buf, types.CopyToContainerOptions{AllowOverwriteDirWithFile: true, CopyUIDGID: true})
} }
func (d *docker) CopyFromContainer(containerName, filePath string) (io.Reader, error) { func (d *docker) CopyFromContainer(containerName, filePath string) (io.Reader, error) {