mirror of
https://github.com/freedomofpress/dangerzone.git
synced 2025-04-28 18:02:38 +02:00
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:
parent
73b0f8b7d4
commit
2e3ec0cece
1 changed files with 17 additions and 9 deletions
|
@ -37,28 +37,36 @@ 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():
|
||||
print("Pulling base image")
|
||||
subprocess.run(
|
||||
[
|
||||
args.runtime,
|
||||
"pull",
|
||||
"alpine:latest",
|
||||
],
|
||||
check=True,
|
||||
)
|
||||
if not args.use_cache:
|
||||
print("Pulling base image")
|
||||
subprocess.run(
|
||||
[
|
||||
args.runtime,
|
||||
"pull",
|
||||
"alpine:latest",
|
||||
],
|
||||
check=True,
|
||||
)
|
||||
|
||||
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",
|
||||
|
|
Loading…
Reference in a new issue