mirror of https://github.com/vector-im/riot-web
Cypress: only pass -u arg to docker on *nix systems (#8773)
parent
fa8c346dfa
commit
9c44e6c1de
|
@ -112,6 +112,12 @@ async function synapseStart(template: string): Promise<SynapseInstance> {
|
||||||
const containerName = `react-sdk-cypress-synapse-${crypto.randomBytes(4).toString("hex")}`;
|
const containerName = `react-sdk-cypress-synapse-${crypto.randomBytes(4).toString("hex")}`;
|
||||||
const userInfo = os.userInfo();
|
const userInfo = os.userInfo();
|
||||||
|
|
||||||
|
let userParams: string[] = [];
|
||||||
|
if (userInfo.uid >= 0) {
|
||||||
|
// On *nix we run the docker container as our uid:gid otherwise cleaning it up its media_store can be difficult
|
||||||
|
userParams = ["-u", `${userInfo.uid}:${userInfo.gid}`];
|
||||||
|
}
|
||||||
|
|
||||||
const synapseId = await new Promise<string>((resolve, reject) => {
|
const synapseId = await new Promise<string>((resolve, reject) => {
|
||||||
childProcess.execFile('docker', [
|
childProcess.execFile('docker', [
|
||||||
"run",
|
"run",
|
||||||
|
@ -119,8 +125,7 @@ async function synapseStart(template: string): Promise<SynapseInstance> {
|
||||||
"-d",
|
"-d",
|
||||||
"-v", `${synCfg.configDir}:/data`,
|
"-v", `${synCfg.configDir}:/data`,
|
||||||
"-p", `${synCfg.port}:8008/tcp`,
|
"-p", `${synCfg.port}:8008/tcp`,
|
||||||
// We run the docker container as our uid:gid otherwise cleaning it up its media_store can be difficult
|
...userParams,
|
||||||
"-u", `${userInfo.uid}:${userInfo.gid}`,
|
|
||||||
"matrixdotorg/synapse:develop",
|
"matrixdotorg/synapse:develop",
|
||||||
"run",
|
"run",
|
||||||
], (err, stdout) => {
|
], (err, stdout) => {
|
||||||
|
|
Loading…
Reference in New Issue