From 17d371c804a2e61721a25103c3262ca90563d051 Mon Sep 17 00:00:00 2001 From: William Petit Date: Mon, 10 Jul 2017 17:24:12 +0200 Subject: [PATCH] Add flag to append custom arguments to the docker run command --- package | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/package b/package index 4d95fe7..72f9032 100755 --- a/package +++ b/package @@ -21,6 +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("--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("-d", "--docker-arg", help="Additional argument to pass to the Docker execution", default=[], action='append') return parser @@ -63,7 +64,7 @@ if __name__ == "__main__": parser = create_args_parser() args = parser.parse_args() - validate_args(args) + print(args.docker_arg) if args.cleanup: cleanup(debug=args.debug) @@ -111,6 +112,9 @@ if __name__ == "__main__": else: docker_args += [image_tag, "/usr/bin/python3", "/tamarin/lib/build.py", args.profile, args.architecture] + # Append custom arguments + docker_args += args.docker_arg + # Start container tamarin.run_docker(docker_args, **kwargs)