From 034c65885f57de031138b492146d7b4acc9ba9cf Mon Sep 17 00:00:00 2001 From: John Richards Date: Thu, 21 Oct 2021 22:22:31 -0400 Subject: [PATCH] Use the -u param when running via Docker --- scripts/pymultic | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/pymultic b/scripts/pymultic index e73efb6..63c94ff 100755 --- a/scripts/pymultic +++ b/scripts/pymultic @@ -53,7 +53,8 @@ PYVER_CONTAINERS = { '3.9', '3.10', } -CONTAINER_EXES = ['docker', 'podman'] +CONTAINER_EXES = ['podman', 'docker'] +CONTAINER_EXE_ARGS = { 'docker': ['-u', '{}:{}'.format(os.getuid(), os.getgid())] } # Docker requires extra magic for permissions. def fetch_python(snekdir, version): @@ -219,7 +220,8 @@ def container_compile(ver, infile): os.unlink(outfile) print('*** Compiling for Python {}'.format(fullver)) - proc = subprocess.Popen([container_exe, 'run', '--rm', '--name', '{}'.format(outfile), + proc = subprocess.Popen([container_exe, 'run'] + CONTAINER_EXE_ARGS.get(container_exe, []) + + ['--rm', '--name', '{}'.format(outfile), '-v', '{}:/indir:Z'.format(indir), '-v', '{}:/outdir:Z'.format(os.getcwd()), '-w', '/outdir', 'python:{}'.format(fullver),