mirror of
https://github.com/docker/compose.git
synced 2025-07-22 21:24:38 +02:00
Merge pull request #1821 from ndeloof/autoremove_restart_policy
Don't apply restart_policy on `compose run`
This commit is contained in:
commit
6bfdfa8947
@ -470,6 +470,7 @@ func (s *composeService) startService(ctx context.Context, project *types.Projec
|
|||||||
Filters: filters.NewArgs(
|
Filters: filters.NewArgs(
|
||||||
projectFilter(project.Name),
|
projectFilter(project.Name),
|
||||||
serviceFilter(service.Name),
|
serviceFilter(service.Name),
|
||||||
|
oneOffFilter(false),
|
||||||
),
|
),
|
||||||
All: true,
|
All: true,
|
||||||
})
|
})
|
||||||
|
@ -50,6 +50,10 @@ func (s *composeService) RunOneOffContainer(ctx context.Context, project *types.
|
|||||||
}
|
}
|
||||||
service.Scale = 1
|
service.Scale = 1
|
||||||
service.StdinOpen = true
|
service.StdinOpen = true
|
||||||
|
service.Restart = ""
|
||||||
|
if service.Deploy != nil {
|
||||||
|
service.Deploy.RestartPolicy = nil
|
||||||
|
}
|
||||||
service.Labels = service.Labels.Add(api.SlugLabel, slug)
|
service.Labels = service.Labels.Add(api.SlugLabel, slug)
|
||||||
service.Labels = service.Labels.Add(api.OneoffLabel, "True")
|
service.Labels = service.Labels.Add(api.OneoffLabel, "True")
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user