File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change 2626import time
2727from contextlib import closing
2828from io import BytesIO
29- from pathlib import Path
3029from textwrap import dedent
3130from typing import Any , Optional
3231
@@ -410,13 +409,8 @@ def __init__(
410409
411410 if build_new_image :
412411 self .logger .log (f"Building Docker image { self .image_name } ..." , level = LogLevel .INFO )
413- dockerfile_path = Path (__file__ ).parent / "Dockerfile"
414- if not dockerfile_path .exists ():
415- with open (dockerfile_path , "w" ) as f :
416- f .write (self .dockerfile_content )
417- _ , build_logs = self .client .images .build (
418- path = str (dockerfile_path .parent ), dockerfile = str (dockerfile_path ), tag = self .image_name
419- )
412+ dockerfile_obj = BytesIO (self .dockerfile_content .encode ("utf-8" ))
413+ _ , build_logs = self .client .images .build (fileobj = dockerfile_obj , tag = self .image_name )
420414 for log_chunk in build_logs :
421415 # Only log non-empty messages
422416 if log_message := log_chunk .get ("stream" , "" ).rstrip ():
You can’t perform that action at this time.
0 commit comments