2018-05-03 16:55:09 +00:00
|
|
|
import os
|
2018-05-01 22:37:36 +00:00
|
|
|
import subprocess
|
2018-05-03 16:55:09 +00:00
|
|
|
import pdb
|
2018-05-01 22:37:36 +00:00
|
|
|
|
2018-05-03 16:55:09 +00:00
|
|
|
SCRIPTPATH = os.path.realpath(__file__)
|
|
|
|
SCRIPTDIR = os.path.dirname(SCRIPTPATH)
|
|
|
|
DOCKERDIR = os.path.join(SCRIPTDIR, 'docker')
|
|
|
|
COLOVEDIR = '/home/colove'
|
|
|
|
|
|
|
|
def dockerrun(
|
|
|
|
colovevolperms='rw', hostname='colove'):
|
2018-05-02 02:10:19 +00:00
|
|
|
args = [
|
|
|
|
'docker', 'run',
|
|
|
|
'--rm',
|
|
|
|
'--interactive',
|
|
|
|
'--tty',
|
2018-05-03 16:55:09 +00:00
|
|
|
'--volume', f'{SCRIPTDIR}:{COLOVEDIR}:{colovevolperms}',
|
|
|
|
'--hostname', hostname,
|
2018-05-02 02:10:19 +00:00
|
|
|
'colove:latest']
|
|
|
|
subprocess.run(args)
|
2018-05-01 22:37:36 +00:00
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
dockerrun()
|