aider: Added a build_docker() function that builds a docker image called benchmark from the benchmark/Dockerfile with no other fs context.

# Context:
USER: add a build_docker() func that builds a docker image called `benchmark` from the benchmark/Dockerfile with no other fs context
This commit is contained in:
Paul Gauthier 2023-06-26 20:41:38 -07:00
parent 095f47593d
commit 898d98fdb3

View file

@ -393,5 +393,31 @@ def run_unit_tests(testdir, history_fname):
return res
def build_docker():
command = [
"docker",
"build",
"-t",
"benchmark",
"benchmark/",
]
print(" ".join(command))
try:
result = subprocess.run(
command,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
text=True,
)
res = result.stdout
print(res)
except subprocess.CalledProcessError as e:
res = f"Failed to build Docker image: {e.output}"
return res
if __name__ == "__main__":
app()