@@ -275,9 +275,6 @@ def build(self, options):
275275 """
276276 service_names = options ['SERVICE' ]
277277 build_args = options .get ('--build-arg' , None )
278- environment_file = options .get ('--env-file' )
279- environment = Environment .from_env_file (self .project_dir , environment_file )
280- native_builder = environment .get_boolean ('COMPOSE_NATIVE_BUILDER' )
281278 if build_args :
282279 if not service_names and docker .utils .version_lt (self .project .client .api_version , '1.25' ):
283280 raise UserError (
@@ -286,6 +283,8 @@ def build(self, options):
286283 )
287284 build_args = resolve_build_args (build_args , self .toplevel_environment )
288285
286+ native_builder = self .toplevel_environment .get_boolean ('COMPOSE_NATIVE_BUILDER' )
287+
289288 self .project .build (
290289 service_names = options ['SERVICE' ],
291290 no_cache = bool (options .get ('--no-cache' , False )),
@@ -1075,6 +1074,8 @@ def up(self, options):
10751074 for excluded in [x for x in opts if options .get (x ) and no_start ]:
10761075 raise UserError ('--no-start and {} cannot be combined.' .format (excluded ))
10771076
1077+ native_builder = self .toplevel_environment .get_boolean ('COMPOSE_NATIVE_BUILDER' )
1078+
10781079 with up_shutdown_context (self .project , service_names , timeout , detached ):
10791080 warn_for_swarm_mode (self .project .client )
10801081
@@ -1094,6 +1095,7 @@ def up(rebuild):
10941095 reset_container_image = rebuild ,
10951096 renew_anonymous_volumes = options .get ('--renew-anon-volumes' ),
10961097 silent = options .get ('--quiet-pull' ),
1098+ cli = native_builder ,
10971099 )
10981100
10991101 try :
0 commit comments