OVerride all
This commit is contained in:
parent
7f8a13bd52
commit
f1bccc8e23
14
package
14
package
|
@ -21,7 +21,7 @@ def create_args_parser():
|
||||||
parser.add_argument("--rebuild", help="Ignore cache and rebuild container's image", action="store_true", default=False)
|
parser.add_argument("--rebuild", help="Ignore cache and rebuild container's image", action="store_true", default=False)
|
||||||
parser.add_argument("--debug", help="Will add extra output and start the container in interactive mode", action="store_true", default=False)
|
parser.add_argument("--debug", help="Will add extra output and start the container in interactive mode", action="store_true", default=False)
|
||||||
parser.add_argument("--cleanup", help="Clear the workspace and remove obsolete Docker images before build", action="store_true", default=False)
|
parser.add_argument("--cleanup", help="Clear the workspace and remove obsolete Docker images before build", action="store_true", default=False)
|
||||||
parser.add_argument("-f", "--override-run-flags", help="Override 'docker run' flags", default=[], action='append')
|
parser.add_argument("--override-docker-args", help="Override all 'docker run' arguments. You can use this flag multiple times to add custom arguments", default=[], action='append')
|
||||||
|
|
||||||
return parser
|
return parser
|
||||||
|
|
||||||
|
@ -86,15 +86,15 @@ if __name__ == "__main__":
|
||||||
kwargs = dict()
|
kwargs = dict()
|
||||||
kwargs['debug'] = args.debug
|
kwargs['debug'] = args.debug
|
||||||
|
|
||||||
docker_args = [
|
docker_args = []
|
||||||
"run",
|
|
||||||
"--rm",
|
|
||||||
]
|
|
||||||
|
|
||||||
# Append custom arguments
|
# Append custom arguments
|
||||||
if len(args.override_run_flags) > 0:
|
if len(args.override_docker_args) > 0:
|
||||||
docker_args += args.override_run_flags
|
docker_args += args.override_docker_args
|
||||||
else:
|
else:
|
||||||
|
|
||||||
|
docker_args += [ "run", "--rm" ]
|
||||||
|
|
||||||
# volumes definition
|
# volumes definition
|
||||||
docker_args += [
|
docker_args += [
|
||||||
"-v", "{:s}:/src:ro".format(project_dir),
|
"-v", "{:s}:/src:ro".format(project_dir),
|
||||||
|
|
Loading…
Reference in New Issue