Dockerdevice: Make sure that container is started

When a QtcProcess is the first thing using a dockerdevice
the container was not started and the call would fail.

Adding updateContainerAccess to withDockerExecCmd
makes sure that the container is started.

Change-Id: I7e05df1aa5e05dc55606970214109b13b142181e
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Marcus Tillmanns
2022-09-29 09:04:45 +02:00
parent 18376ebb24
commit 736f778e6d

View File

@@ -143,7 +143,7 @@ public:
Environment environment();
CommandLine withDockerExecCmd(const CommandLine &cmd, bool interactive = false) const;
CommandLine withDockerExecCmd(const CommandLine &cmd, bool interactive = false);
private:
bool createContainer();
@@ -395,11 +395,13 @@ void DockerDevice::updateContainerAccess() const
d->updateContainerAccess();
}
CommandLine DockerDevicePrivate::withDockerExecCmd(const CommandLine &cmd, bool interactive) const
CommandLine DockerDevicePrivate::withDockerExecCmd(const CommandLine &cmd, bool interactive)
{
if (!m_settings)
return {};
updateContainerAccess();
QStringList args;
args << "exec";