mirror of
https://github.com/docker/compose.git
synced 2025-07-24 06:04:57 +02:00
Merge pull request #11213 from glours/watch-force-build-at-startup
in watch mode force pull policy to build for services with both build and develop attributes
This commit is contained in:
commit
587dba1167
@ -20,6 +20,8 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/compose-spec/compose-go/types"
|
||||||
|
|
||||||
"github.com/docker/cli/cli/command"
|
"github.com/docker/cli/cli/command"
|
||||||
"github.com/docker/compose/v2/internal/locker"
|
"github.com/docker/compose/v2/internal/locker"
|
||||||
"github.com/docker/compose/v2/pkg/api"
|
"github.com/docker/compose/v2/pkg/api"
|
||||||
@ -85,6 +87,12 @@ func runWatch(ctx context.Context, dockerCli command.Cli, backend api.Service, w
|
|||||||
}
|
}
|
||||||
|
|
||||||
if !watchOpts.noUp {
|
if !watchOpts.noUp {
|
||||||
|
for index, service := range project.Services {
|
||||||
|
if service.Build != nil && service.Develop != nil {
|
||||||
|
service.PullPolicy = types.PullPolicyBuild
|
||||||
|
}
|
||||||
|
project.Services[index] = service
|
||||||
|
}
|
||||||
upOpts := api.UpOptions{
|
upOpts := api.UpOptions{
|
||||||
Create: api.CreateOptions{
|
Create: api.CreateOptions{
|
||||||
Build: &build,
|
Build: &build,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user