diff --git a/pkg/compose/secrets.go b/pkg/compose/secrets.go index e3493fa92..581c9c07a 100644 --- a/pkg/compose/secrets.go +++ b/pkg/compose/secrets.go @@ -45,7 +45,7 @@ func (s *composeService) injectSecrets(ctx context.Context, project *types.Proje } err = s.apiClient().CopyToContainer(ctx, id, "/", &b, moby.CopyToContainerOptions{ - CopyUIDGID: true, + CopyUIDGID: config.UID != "" || config.GID != "", }) if err != nil { return err