forked from qt-creator/qt-creator
Docker: Switch Linux file handling to docker --exec by default
Also on Linux, where there's actually a choice. It's slower, but less fragile when it comes to user ids and/or file system permissions. Change-Id: I811612fcff65fad50be18bed21150f6ca7fae93c Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -396,6 +396,13 @@ public:
|
||||
data.useLocalUidGid = on;
|
||||
});
|
||||
|
||||
// This tries to find the directory in the host file system that corresponds to the
|
||||
// docker container root file system, which is a merge of the layers from the
|
||||
// container image and the volumes mapped using -v on container startup.
|
||||
//
|
||||
// Accessing files there is much faster than using 'docker exec', but conceptually
|
||||
// only works on Linux, and is restricted there by proper matching of user
|
||||
// permissions between host and container.
|
||||
m_usePathMapping = new QCheckBox(tr("Use local file path mapping"));
|
||||
m_usePathMapping->setToolTip(tr("Maps docker filesystem to a local directory."));
|
||||
m_usePathMapping->setChecked(data.useFilePathMapping);
|
||||
@@ -960,8 +967,10 @@ void DockerDevicePrivate::tryCreateLocalFileAccess()
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (!DockerPlugin::isDaemonRunning().value_or(false))
|
||||
return;
|
||||
|
||||
QtcProcess proc;
|
||||
proc.setCommand({"docker", {"inspect", "--format={{.GraphDriver.Data.MergedDir}}", m_container}});
|
||||
LOG(proc.commandLine().toUserOutput());
|
||||
|
||||
@@ -44,7 +44,7 @@ public:
|
||||
QString tag;
|
||||
QString size;
|
||||
bool useLocalUidGid = true;
|
||||
bool useFilePathMapping = true;
|
||||
bool useFilePathMapping = false;
|
||||
QStringList mounts;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user