From ae56770cf2ce2a0ac9e823570cc8288e97b82ebe Mon Sep 17 00:00:00 2001 From: blam Date: Mon, 10 Aug 2020 21:23:54 +0200 Subject: [PATCH] chore(scaffolder): fixing some of the docs and making things a little cleanern --- .../src/scaffolder/stages/templater/helpers.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/plugins/scaffolder-backend/src/scaffolder/stages/templater/helpers.ts b/plugins/scaffolder-backend/src/scaffolder/stages/templater/helpers.ts index 2bda4e0f80..a3dea7ea5a 100644 --- a/plugins/scaffolder-backend/src/scaffolder/stages/templater/helpers.ts +++ b/plugins/scaffolder-backend/src/scaffolder/stages/templater/helpers.ts @@ -72,11 +72,6 @@ export const runDockerContainer = async ({ }); }); - // Files that are created inside the Docker container will be owned by - // root on the host system on non Mac systems, because of reasons. Mainly the fact that - // volume sharing is done using NFS on Mac and actual mounts in Linux world. - // So we set the user in the container as the same user and group id as the host. - const User = `${process.getuid()}:${process.getgid()}`; const [{ Error: error, StatusCode: statusCode }] = await dockerClient.run( imageName, args, @@ -91,7 +86,13 @@ export const runDockerContainer = async ({ `${await fs.promises.realpath(templateDir)}:/template`, ], }, - User, + // Files that are created inside the Docker container will be owned by + // root on the host system on non Mac systems, because of reasons. Mainly the fact that + // volume sharing is done using NFS on Mac and actual mounts in Linux world. + // So we set the user in the container as the same user and group id as the host. + User: `${process.getuid()}:${process.getgid()}`, + // Set the home directory inside the container as something that applications can + // write to, otherwise they will just flop and fail trying to write to / Env: ['HOME=/tmp'], ...createOptions, },