Docker: Fix DockerDevice::runProcess again

We need the on-device path in "docker exec", not the global version of it.

This was not visible earlier as some more places used local paths,
accidentally matching the on-device path.

Change-Id: If1d7e94d2cf0730e85e5a89972d7eaa309743fa6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2021-05-25 13:23:57 +02:00
parent fcf9c42e40
commit 984d992abf

View File

@@ -715,14 +715,18 @@ QByteArray DockerDevice::fileContents(const FilePath &filePath, int limit) const
void DockerDevice::runProcess(QtcProcess &process) const
{
CommandLine dcmd{"docker", {"exec"}};
dcmd.addArgs({"-w", process.workingDirectory()});
dcmd.addArg(d->m_container);
dcmd.addArgs(process.commandLine());
const QString origWd = process.workingDirectory();
const CommandLine origCmd = process.commandLine();
LOG("Run" << dcmd.toUserOutput());
CommandLine cmd{"docker", {"exec"}};
cmd.addArgs({"-w", process.workingDirectory()});
cmd.addArg(d->m_container);
cmd.addArg(origCmd.executable().path()); // Cut off the docker://.../ bits.
cmd.addArgs(origCmd.splitArguments(osType()));
process.setCommand(dcmd);
LOG("Run" << cmd.toUserOutput());
process.setCommand(cmd);
process.start();
}