From faf60833529f342656506bfda5ecbfbf5fd4822a Mon Sep 17 00:00:00 2001 From: Diptanu Choudhury Date: Fri, 5 Feb 2016 00:22:31 -0800 Subject: [PATCH] Passing the log rotation parameters to docker daemon --- client/driver/docker.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/client/driver/docker.go b/client/driver/docker.go index ba2d49407..78601817c 100644 --- a/client/driver/docker.go +++ b/client/driver/docker.go @@ -229,6 +229,13 @@ func (d *DockerDriver) createContainer(ctx *ExecContext, task *structs.Task, dri // local directory for storage and a shared alloc directory that can be // used to share data between different tasks in the same task group. Binds: binds, + LogConfig: docker.LogConfig{ + Type: "json-file", + Config: map[string]string{ + "max-size": fmt.Sprintf("%dm", task.LogConfig.MaxFileSizeMB), + "max-file": strconv.Itoa(task.LogConfig.MaxFiles), + }, + }, } d.logger.Printf("[DEBUG] driver.docker: using %d bytes memory for %s", hostConfig.Memory, task.Config["image"])