@@ -43,7 +43,6 @@ def ecr_login_boto3(region: str, account_id: str):
43
43
def ensure_buildx_builder (builder_name : str = DEFAULT_BUILDER_NAME ) -> str :
44
44
"""
45
45
Ensures a Docker Buildx builder exists for multi-platform builds.
46
- This function is safe for concurrent execution across multiple processes.
47
46
48
47
:param builder_name: Name for the buildx builder
49
48
:return: The builder name that was created or reused
@@ -67,13 +66,6 @@ def ensure_buildx_builder(builder_name: str = DEFAULT_BUILDER_NAME) -> str:
67
66
)
68
67
logger .info (f"Created new buildx builder: { builder_name } " )
69
68
except DockerException as e :
70
- # Check if this is a race condition (another process created the builder)
71
- if hasattr (e , 'stderr' ) and 'existing instance for' in str (e .stderr ):
72
- logger .info (f"Builder '{ builder_name } ' was created by another process – using it." )
73
- docker .buildx .use (builder_name )
74
- return builder_name
75
-
76
- # Otherwise, it's a real error
77
69
logger .error (f"Failed to create buildx builder: { e } " )
78
70
raise
79
71
@@ -119,10 +111,7 @@ def execute_docker_build(
119
111
if len (platforms ) > 1 :
120
112
logger .info (f"Multi-platform build for { len (platforms )} architectures" )
121
113
122
- # Ensure buildx builder exists (safe for concurrent execution)
123
- ensure_buildx_builder (builder_name )
124
-
125
- # Build the image using buildx
114
+ # Build the image using buildx, builder must be already initialized
126
115
docker_cmd .buildx .build (
127
116
context_path = path ,
128
117
file = dockerfile ,
0 commit comments