Passing the log rotation parameters to docker daemon

This commit is contained in:
Diptanu Choudhury 2016-02-05 00:22:31 -08:00
parent 91e7922f3b
commit faf6083352

View file

@ -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"])