1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-25 11:52:40 +01:00

docker: add user to sudo group in docker image (only applicable for ubuntu)

This commit is contained in:
Anonymous Maarten 2018-06-07 17:31:45 +02:00
parent cd55d17639
commit 0c3dc78916

View File

@ -44,6 +44,9 @@ def create(ns: argparse.Namespace):
'--uid', str(ns.uid), '-g', ns.username, ns.username])
sub_run(['docker', 'exec', ns.name, 'chown', '{0}:{0}'.format(ns.username),
'/build'])
sub_run(['docker', 'exec', ns.name, 'usermod', '-a', '-G', 'sudo', ns.username])
sub_run(['docker', 'exec', ns.name, '/bin/bash', '-c', 'printf "{0}:{0}" | chpasswd'.format(ns.username)])
sub_run(['docker', 'exec', ns.name, '/bin/bash', '-c', 'printf "{0} ALL= NOPASSWD: ALL\n" >> /etc/sudoers'.format(ns.username)])
def exec(ns: argparse.Namespace):