Use the -u param when running via Docker

This commit is contained in:
John Richards
2021-10-21 22:22:31 -04:00
parent 7e2609c3d6
commit 034c65885f

View File

@@ -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),