mirror of
https://github.com/docker/compose.git
synced 2025-07-07 05:44:25 +02:00
Fix logs (concurrent access to container.ID, logs was displaying the first container logs for every container)
Signed-off-by: Guillaume Tardif <guillaume.tardif@docker.com>
This commit is contained in:
parent
a701fd7601
commit
da99ad40d5
@ -191,10 +191,11 @@ func (s *local) Logs(ctx context.Context, projectName string, w io.Writer) error
|
|||||||
consumer := formatter.NewLogConsumer(w)
|
consumer := formatter.NewLogConsumer(w)
|
||||||
for _, c := range list {
|
for _, c := range list {
|
||||||
service := c.Labels["com.docker.compose.service"]
|
service := c.Labels["com.docker.compose.service"]
|
||||||
|
containerId := c.ID
|
||||||
go func() {
|
go func() {
|
||||||
s.containerService.Logs(ctx, c.ID, containers.LogsRequest{
|
s.containerService.Logs(ctx,containerId, containers.LogsRequest{
|
||||||
Follow: true,
|
Follow: true,
|
||||||
Writer: consumer.GetWriter(service, c.ID),
|
Writer: consumer.GetWriter(service, containerId),
|
||||||
})
|
})
|
||||||
wg.Done()
|
wg.Done()
|
||||||
}()
|
}()
|
||||||
@ -534,7 +535,6 @@ func (s *local) ensureNetwork(ctx context.Context, n types.NetworkConfig) error
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func (s *local) ensureVolume(ctx context.Context, volume types.VolumeConfig) error {
|
func (s *local) ensureVolume(ctx context.Context, volume types.VolumeConfig) error {
|
||||||
// TODO could identify volume by label vs name
|
// TODO could identify volume by label vs name
|
||||||
_, err := s.volumeService.Inspect(ctx, volume.Name)
|
_, err := s.volumeService.Inspect(ctx, volume.Name)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user