mirror of https://github.com/docker/compose.git
don't apply restart_policy on `compose run`
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
796d08d778
commit
852aae0a39
|
@ -470,6 +470,7 @@ func (s *composeService) startService(ctx context.Context, project *types.Projec
|
|||
Filters: filters.NewArgs(
|
||||
projectFilter(project.Name),
|
||||
serviceFilter(service.Name),
|
||||
oneOffFilter(false),
|
||||
),
|
||||
All: true,
|
||||
})
|
||||
|
|
|
@ -50,6 +50,10 @@ func (s *composeService) RunOneOffContainer(ctx context.Context, project *types.
|
|||
}
|
||||
service.Scale = 1
|
||||
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.OneoffLabel, "True")
|
||||
|
||||
|
|
Loading…
Reference in New Issue