Add flag to append custom arguments to the docker run command

This commit is contained in:
wpetit 2017-07-10 17:24:12 +02:00
parent caac9056fa
commit 17d371c804
1 changed files with 5 additions and 1 deletions

View File

@ -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)