shell: docker run needs shell

don't want to get into parsing quotes!
This commit is contained in:
Girish Ramakrishnan
2024-02-22 10:34:56 +01:00
parent a6f078330f
commit 60994f9ed1
4 changed files with 42 additions and 41 deletions
+5 -5
View File
@@ -103,7 +103,7 @@ async function start(existingInfra) {
const cmd = serviceConfig.recoveryMode ? '/bin/bash -c \'echo "Debug mode. Sleeping" && sleep infinity\'' : '';
const mounts = dataDirs.map(v => `-v "${v.hostDir}:${v.mountDir}"`).join(' ');
const runCmd = `docker run --restart=always -d --name="sftp" \
const runCmd = `docker run --restart=always -d --name=sftp \
--hostname sftp \
--net cloudron \
--net-alias sftp \
@@ -117,15 +117,15 @@ async function start(existingInfra) {
--dns-search=. \
-p 222:22 \
${mounts} \
-e CLOUDRON_SFTP_TOKEN="${cloudronToken}" \
-v "${paths.SFTP_KEYS_DIR}:/etc/ssh:ro" \
-e CLOUDRON_SFTP_TOKEN=${cloudronToken} \
-v ${paths.SFTP_KEYS_DIR}:/etc/ssh:ro \
--label isCloudronManaged=true \
${readOnly} -v /tmp -v /run "${image}" ${cmd}`;
${readOnly} -v /tmp -v /run ${image} ${cmd}`;
// ignore error if container not found (and fail later) so that this code works across restarts
await safe(shell.exec('stopSftp', 'docker stop sftp', {})); // ignore error
await safe(shell.exec('removeSftp', 'docker rm -f sftp', {})); // ignore error
await shell.exec('startSftp', runCmd, {});
await shell.exec('startSftp', runCmd, { shell: '/bin/bash' });
}
async function status() {