-
Notifications
You must be signed in to change notification settings - Fork 457
/
docker.go
51 lines (42 loc) · 1.28 KB
/
docker.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package service
import (
"github.com/autonomy/dianemo/src/initramfs/cmd/init/pkg/service/conditions"
"github.com/autonomy/dianemo/src/initramfs/pkg/userdata"
)
// Docker implements the Service interface. It serves as the concrete type with
// the required methods.
type Docker struct{}
// Pre implements the Service interface.
func (p *Docker) Pre(data userdata.UserData) error {
return nil
}
// Post implements the Service interface.
func (p *Docker) Post(data userdata.UserData) (err error) {
return nil
}
// Cmd implements the Service interface.
func (p *Docker) Cmd(data userdata.UserData, cmdArgs *CmdArgs) error {
cmdArgs.Name = "docker"
cmdArgs.Path = "/bin/dockerd"
cmdArgs.Args = []string{
"--live-restore",
"--iptables=false",
"--ip-masq=false",
"--storage-driver=overlay2",
"--selinux-enabled=false",
"--exec-opt=native.cgroupdriver=cgroupfs",
"--log-opt=max-size=10m",
"--log-opt=max-file=3",
}
return nil
}
// Condition implements the Service interface.
func (p *Docker) Condition(data userdata.UserData) func() (bool, error) {
return conditions.None()
}
// Env implements the Service interface.
func (p *Docker) Env() []string {
return []string{"DOCKER_NOFILE=1000000"}
}
// Type implements the Service interface.
func (p *Docker) Type() Type { return Forever }