mirror of
https://github.com/ChristianLight/tutor.git
synced 2024-12-13 14:43:03 +00:00
Add --no-cache
option to images build
This commit is contained in:
parent
4e98b020db
commit
0a49c2422a
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
## Latest
|
## Latest
|
||||||
|
|
||||||
|
- [Improvement] Add `--no-cache` option to `images build`
|
||||||
- [Improvement] Make it possible to configure the notes service hostname
|
- [Improvement] Make it possible to configure the notes service hostname
|
||||||
|
|
||||||
## 3.3.10 (2019-05-15)
|
## 3.3.10 (2019-05-15)
|
||||||
|
@ -36,18 +36,23 @@ argument_image = click.argument(
|
|||||||
)
|
)
|
||||||
@opts.root
|
@opts.root
|
||||||
@argument_openedx_image
|
@argument_openedx_image
|
||||||
|
@click.option(
|
||||||
|
"--no-cache", is_flag=True, help="Do not use cache when building the image"
|
||||||
|
)
|
||||||
@click.option(
|
@click.option(
|
||||||
"-a",
|
"-a",
|
||||||
"--build-arg",
|
"--build-arg",
|
||||||
multiple=True,
|
multiple=True,
|
||||||
help="Set build-time docker ARGS in the form 'myarg=value'. This option may be specified multiple times.",
|
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)
|
config = tutor_config.load(root)
|
||||||
for img in openedx_image_names(config, image):
|
for img in openedx_image_names(config, image):
|
||||||
tag = get_tag(config, img)
|
tag = get_tag(config, img)
|
||||||
click.echo(fmt.info("Building image {}".format(tag)))
|
click.echo(fmt.info("Building image {}".format(tag)))
|
||||||
command = ["build", "-t", tag, tutor_env.pathjoin(root, "build", img)]
|
command = ["build", "-t", tag, tutor_env.pathjoin(root, "build", img)]
|
||||||
|
if no_cache:
|
||||||
|
command.append("--no-cache")
|
||||||
for arg in build_arg:
|
for arg in build_arg:
|
||||||
command += ["--build-arg", arg]
|
command += ["--build-arg", arg]
|
||||||
utils.docker(*command)
|
utils.docker(*command)
|
||||||
|
Loading…
Reference in New Issue
Block a user