From 2c1b790aaee3651c1c05d6753bfc2037c18cdd62 Mon Sep 17 00:00:00 2001 From: Jeffrey Townsend Date: Wed, 17 Feb 2016 09:27:58 -0800 Subject: [PATCH] Mount the current working directory in addition to $HOME by default. Previously only $HOME was mounted in developer mode. Now $HOME and $CWD are both mounted for convenience. This can be disabled using the --no-mount-current option. --- docker/tools/onlbuilder | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docker/tools/onlbuilder b/docker/tools/onlbuilder index 1795fdfc..4f963519 100755 --- a/docker/tools/onlbuilder +++ b/docker/tools/onlbuilder @@ -96,6 +96,10 @@ ap.add_argument("--volumes", metavar='DIRECTORY', default=[]) +ap.add_argument("--no-mount-current", + help="Do not mount the current working directory. The default is the current working directory and $HOME", + action='store_true') + ap.add_argument("--autobuild", help="Automatic build in isolation mode.", action='store_true') @@ -159,6 +163,11 @@ if ops.exec_: else: ops.volumes += [ '/lib/modules' ] + + if not ops.no_mount_current: + # Add the current working directory to the volume list. + ops.volumes.append(os.getcwd()) + g_arg_d['volume_options'] = " ".join( [ " -v %s:%s " % (v, v) for v in ops.volumes ] ) g_docker_arguments = "docker run --privileged %(interactive)s -t -e DOCKER_IMAGE=%(image)s --name %(name)s %(ssh_options)s %(volume_options)s " % g_arg_d