6
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-12-13 06:37:46 +00:00

Add --no-cache option to images build

This commit is contained in:
Régis Behmo 2019-05-22 19:17:54 +02:00
parent 4e98b020db
commit 0a49c2422a
2 changed files with 7 additions and 1 deletions

View File

@ -2,6 +2,7 @@
## Latest
- [Improvement] Add `--no-cache` option to `images build`
- [Improvement] Make it possible to configure the notes service hostname
## 3.3.10 (2019-05-15)

View File

@ -36,18 +36,23 @@ argument_image = click.argument(
)
@opts.root
@argument_openedx_image
@click.option(
"--no-cache", is_flag=True, help="Do not use cache when building the image"
)
@click.option(
"-a",
"--build-arg",
multiple=True,
help="Set build-time docker ARGS in the form 'myarg=value'. This option may be specified multiple times.",
)
def build(root, image, build_arg):
def build(root, image, no_cache, build_arg):
config = tutor_config.load(root)
for img in openedx_image_names(config, image):
tag = get_tag(config, img)
click.echo(fmt.info("Building image {}".format(tag)))
command = ["build", "-t", tag, tutor_env.pathjoin(root, "build", img)]
if no_cache:
command.append("--no-cache")
for arg in build_arg:
command += ["--build-arg", arg]
utils.docker(*command)