Set the default value of --proc to 1
Set the default value of --proc to 1 in case single core user use it
Separate single-core and multi-core cases
@@ -18,7 +18,7 @@ if __name__ == "__main__":
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument(
"--proc",
- default=4,
+ default=1,
type=positive_int,
help="the number of process to build docker images")
parser.add_argument(
@@ -46,6 +46,9 @@ if __name__ == "__main__":
if fn.startswith('Dockerfile.'):
dockerfiles.append(fn.split('.')[-1])
+ if args.proc == 1:
+ [build(tag) for tag in dockerfiles]
+ else:
pool = Pool(processes=args.proc)
pool.map(build, dockerfiles)
pool.close()
