mirror of
https://github.com/bingohuang/docker-labs.git
synced 2025-07-14 01:57:32 +08:00
Limit the container log size to avoid filling the disk
This commit is contained in:
parent
6acb6f47c5
commit
5ac8131a10
@ -200,7 +200,12 @@ func ResizeConnection(name string, cols, rows uint) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func CreateInstance(session *Session, dindImage string) (*Instance, error) {
|
func CreateInstance(session *Session, dindImage string) (*Instance, error) {
|
||||||
h := &container.HostConfig{NetworkMode: container.NetworkMode(session.Id), Privileged: true, AutoRemove: true}
|
h := &container.HostConfig{
|
||||||
|
NetworkMode: container.NetworkMode(session.Id),
|
||||||
|
Privileged: true,
|
||||||
|
AutoRemove: true,
|
||||||
|
LogConfig: container.LogConfig{Config: map[string]string{"max-size": "10m", "max-file": "1"}},
|
||||||
|
}
|
||||||
|
|
||||||
if os.Getenv("APPARMOR_PROFILE") != "" {
|
if os.Getenv("APPARMOR_PROFILE") != "" {
|
||||||
h.SecurityOpt = []string{fmt.Sprintf("apparmor=%s", os.Getenv("APPARMOR_PROFILE"))}
|
h.SecurityOpt = []string{fmt.Sprintf("apparmor=%s", os.Getenv("APPARMOR_PROFILE"))}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user