mirror of
https://github.com/esphome/esphome.git
synced 2024-11-25 16:38:16 +01:00
Add option to load docker image when building (#2938)
This commit is contained in:
parent
cc5947467f
commit
79d73d8f8b
1 changed files with 3 additions and 0 deletions
|
@ -32,6 +32,7 @@ parser.add_argument("--dry-run", action="store_true", help="Don't run any comman
|
||||||
subparsers = parser.add_subparsers(help="Action to perform", dest="command", required=True)
|
subparsers = parser.add_subparsers(help="Action to perform", dest="command", required=True)
|
||||||
build_parser = subparsers.add_parser("build", help="Build the image")
|
build_parser = subparsers.add_parser("build", help="Build the image")
|
||||||
build_parser.add_argument("--push", help="Also push the images", action="store_true")
|
build_parser.add_argument("--push", help="Also push the images", action="store_true")
|
||||||
|
build_parser.add_argument("--load", help="Load the docker image locally", action="store_true")
|
||||||
manifest_parser = subparsers.add_parser("manifest", help="Create a manifest from already pushed images")
|
manifest_parser = subparsers.add_parser("manifest", help="Create a manifest from already pushed images")
|
||||||
|
|
||||||
|
|
||||||
|
@ -132,6 +133,8 @@ def main():
|
||||||
cmd += ["--tag", img]
|
cmd += ["--tag", img]
|
||||||
if args.push:
|
if args.push:
|
||||||
cmd += ["--push", "--cache-to", f"type=registry,ref={cache_img},mode=max"]
|
cmd += ["--push", "--cache-to", f"type=registry,ref={cache_img},mode=max"]
|
||||||
|
if args.load:
|
||||||
|
cmd += ["--load"]
|
||||||
|
|
||||||
run_command(*cmd, ".")
|
run_command(*cmd, ".")
|
||||||
elif args.command == "manifest":
|
elif args.command == "manifest":
|
||||||
|
|
Loading…
Reference in a new issue