mirror of
https://github.com/freedomofpress/dangerzone.git
synced 2025-04-28 18:02:38 +02:00
Speed up container image building (pull + build)
Avoids downloading the container image 4 times in the multi-stage build by first pulling the alpine image once and then building without any pulls. Implemented following a suggestion of @apyrgio.
This commit is contained in:
parent
550786adfe
commit
0a54f6461a
1 changed files with 10 additions and 1 deletions
|
@ -33,12 +33,21 @@ def main():
|
||||||
print("Exporting container pip dependencies")
|
print("Exporting container pip dependencies")
|
||||||
export_container_pip_dependencies()
|
export_container_pip_dependencies()
|
||||||
|
|
||||||
|
print("Pulling base image")
|
||||||
|
subprocess.run(
|
||||||
|
[
|
||||||
|
args.runtime,
|
||||||
|
"pull",
|
||||||
|
"alpine:latest",
|
||||||
|
],
|
||||||
|
check=True,
|
||||||
|
)
|
||||||
|
|
||||||
print("Building container image")
|
print("Building container image")
|
||||||
subprocess.run(
|
subprocess.run(
|
||||||
[
|
[
|
||||||
args.runtime,
|
args.runtime,
|
||||||
"build",
|
"build",
|
||||||
"--pull",
|
|
||||||
BUILD_CONTEXT,
|
BUILD_CONTEXT,
|
||||||
"--build-arg",
|
"--build-arg",
|
||||||
f"REQUIREMENTS_TXT={REQUIREMENTS_TXT}",
|
f"REQUIREMENTS_TXT={REQUIREMENTS_TXT}",
|
||||||
|
|
Loading…
Reference in a new issue