@@ -541,25 +541,25 @@ def file_path(filename):
541541 return os .path .join (image .application .subdirectory , filename )
542542 return filename
543543
544- dockerfile_candidates = ["Dockerfile.cabotage" , "Dockerfile" ]
545- if image .application .dockerfile_path :
546- dockerfile_candidates = [image .application .dockerfile_path ]
547-
548544 dockerfile_name = None
549- dockerfile_body = None
550- for candidate in dockerfile_candidates :
545+ dockerfile_body = _fetch_github_file (
546+ image .application .github_repository ,
547+ image .commit_sha ,
548+ access_token = access_token ,
549+ filename = file_path ("Dockerfile.cabotage" ),
550+ )
551+ dockerfile_name = "Dockerfile.cabotage"
552+ if dockerfile_body is None :
551553 dockerfile_body = _fetch_github_file (
552554 image .application .github_repository ,
553555 image .commit_sha ,
554556 access_token = access_token ,
555- filename = file_path (candidate ),
557+ filename = file_path ("Dockerfile" ),
556558 )
557- if dockerfile_body is not None :
558- dockerfile_name = candidate
559- break
559+ dockerfile_name = "Dockerfile"
560560 if dockerfile_body is None :
561561 raise BuildError (
562- f "No Dockerfile found in "
562+ "No Dockerfile.cabotage or Dockerfile found in root of "
563563 f"{ git_ref (image .application .github_repository , image .commit_sha )} "
564564 )
565565
0 commit comments