@@ -255,6 +255,10 @@ func loadDevelopmentConfig(service types.ServiceConfig, project *types.Project)
255255}
256256
257257func (s * composeService ) makeRebuildFn (ctx context.Context , project * types.Project ) func (services rebuildServices ) {
258+ for i , service := range project .Services {
259+ service .PullPolicy = types .PullPolicyBuild
260+ project .Services [i ] = service
261+ }
258262 return func (services rebuildServices ) {
259263 serviceNames := make ([]string , 0 , len (services ))
260264 allPaths := make (utils.Set [string ])
@@ -271,20 +275,7 @@ func (s *composeService) makeRebuildFn(ctx context.Context, project *types.Proje
271275 strings .Join (serviceNames , ", " ),
272276 strings .Join (append ([]string {"" }, allPaths .Elements ()... ), "\n - " ),
273277 )
274- imageIds , err := s .build (ctx , project , api.BuildOptions {
275- Services : serviceNames ,
276- })
277- if err != nil {
278- fmt .Fprintf (s .stderr (), "Build failed\n " )
279- }
280- for i , service := range project .Services {
281- if id , ok := imageIds [service .Name ]; ok {
282- service .Image = id
283- }
284- project .Services [i ] = service
285- }
286-
287- err = s .Up (ctx , project , api.UpOptions {
278+ err := s .Up (ctx , project , api.UpOptions {
288279 Create : api.CreateOptions {
289280 Services : serviceNames ,
290281 Inherit : true ,
0 commit comments