Always bust builder cache building the container image

Do not use by default the builder cache, when we build the Dangerzone
container image. This way, we can always have the most fresh result when
we run the `./install/common/build-image.py` command.

If a dev wants to speed up non-release builds, we add the `--use-cache`
flag to use the builder cache.
This commit is contained in:
Alex Pyrgiotis 2024-07-24 01:51:50 +03:00
parent 73b0f8b7d4
commit 2e3ec0cece
No known key found for this signature in database
GPG key ID: B6C15EBA0357C9AA

View file

@ -37,12 +37,18 @@ def main():
default=9,
help="The Gzip compression level, from 0 (lowest) to 9 (highest, default)",
)
parser.add_argument(
"--use-cache",
action="store_true",
help="Use the builder's cache to speed up the builds (not suitable for release builds)",
)
args = parser.parse_args()
print(f"Building for architecture '{ARCH}'")
print("Exporting container pip dependencies")
with ContainerPipDependencies():
if not args.use_cache:
print("Pulling base image")
subprocess.run(
[
@ -54,11 +60,13 @@ def main():
)
print("Building container image")
cache_args = [] if args.use_cache else ["--no-cache"]
subprocess.run(
[
args.runtime,
"build",
BUILD_CONTEXT,
*cache_args,
"--build-arg",
f"REQUIREMENTS_TXT={REQUIREMENTS_TXT}",
"--build-arg",