@@ -31,99 +31,100 @@ var deviceCgroupRuleRegexp = regexp.MustCompile(`^[acb] ([0-9]+|\*):([0-9]+|\*)
3131
3232// containerOptions is a data object with all the options for creating a container
3333type containerOptions struct {
34- attach opts.ListOpts
35- volumes opts.ListOpts
36- tmpfs opts.ListOpts
37- mounts opts.MountOpt
38- blkioWeightDevice opts.WeightdeviceOpt
39- deviceReadBps opts.ThrottledeviceOpt
40- deviceWriteBps opts.ThrottledeviceOpt
41- links opts.ListOpts
42- aliases opts.ListOpts
43- linkLocalIPs opts.ListOpts
44- deviceReadIOps opts.ThrottledeviceOpt
45- deviceWriteIOps opts.ThrottledeviceOpt
46- env opts.ListOpts
47- labels opts.ListOpts
48- deviceCgroupRules opts.ListOpts
49- devices opts.ListOpts
50- gpus opts.GpuOpts
51- ulimits * opts.UlimitOpt
52- sysctls * opts.MapOpts
53- publish opts.ListOpts
54- expose opts.ListOpts
55- dns opts.ListOpts
56- dnsSearch opts.ListOpts
57- dnsOptions opts.ListOpts
58- extraHosts opts.ListOpts
59- volumesFrom opts.ListOpts
60- envFile opts.ListOpts
61- capAdd opts.ListOpts
62- capDrop opts.ListOpts
63- groupAdd opts.ListOpts
64- securityOpt opts.ListOpts
65- storageOpt opts.ListOpts
66- labelsFile opts.ListOpts
67- loggingOpts opts.ListOpts
68- privileged bool
69- pidMode string
70- utsMode string
71- usernsMode string
72- cgroupnsMode string
73- publishAll bool
74- stdin bool
75- tty bool
76- oomKillDisable bool
77- oomScoreAdj int
78- containerIDFile string
79- entrypoint string
80- hostname string
81- domainname string
82- memory opts.MemBytes
83- memoryReservation opts.MemBytes
84- memorySwap opts.MemSwapBytes
85- kernelMemory opts.MemBytes
86- user string
87- workingDir string
88- cpuCount int64
89- cpuShares int64
90- cpuPercent int64
91- cpuPeriod int64
92- cpuRealtimePeriod int64
93- cpuRealtimeRuntime int64
94- cpuQuota int64
95- cpus opts.NanoCPUs
96- cpusetCpus string
97- cpusetMems string
98- blkioWeight uint16
99- ioMaxBandwidth opts.MemBytes
100- ioMaxIOps uint64
101- swappiness int64
102- netMode opts.NetworkOpt
103- macAddress string
104- ipv4Address string
105- ipv6Address string
106- ipcMode string
107- pidsLimit int64
108- restartPolicy string
109- readonlyRootfs bool
110- loggingDriver string
111- cgroupParent string
112- volumeDriver string
113- stopSignal string
114- stopTimeout int
115- isolation string
116- shmSize opts.MemBytes
117- noHealthcheck bool
118- healthCmd string
119- healthInterval time.Duration
120- healthTimeout time.Duration
121- healthStartPeriod time.Duration
122- healthRetries int
123- runtime string
124- autoRemove bool
125- init bool
126- annotations * opts.MapOpts
34+ attach opts.ListOpts
35+ volumes opts.ListOpts
36+ tmpfs opts.ListOpts
37+ mounts opts.MountOpt
38+ blkioWeightDevice opts.WeightdeviceOpt
39+ deviceReadBps opts.ThrottledeviceOpt
40+ deviceWriteBps opts.ThrottledeviceOpt
41+ links opts.ListOpts
42+ aliases opts.ListOpts
43+ linkLocalIPs opts.ListOpts
44+ deviceReadIOps opts.ThrottledeviceOpt
45+ deviceWriteIOps opts.ThrottledeviceOpt
46+ env opts.ListOpts
47+ labels opts.ListOpts
48+ deviceCgroupRules opts.ListOpts
49+ devices opts.ListOpts
50+ gpus opts.GpuOpts
51+ ulimits * opts.UlimitOpt
52+ sysctls * opts.MapOpts
53+ publish opts.ListOpts
54+ expose opts.ListOpts
55+ dns opts.ListOpts
56+ dnsSearch opts.ListOpts
57+ dnsOptions opts.ListOpts
58+ extraHosts opts.ListOpts
59+ volumesFrom opts.ListOpts
60+ envFile opts.ListOpts
61+ capAdd opts.ListOpts
62+ capDrop opts.ListOpts
63+ groupAdd opts.ListOpts
64+ securityOpt opts.ListOpts
65+ storageOpt opts.ListOpts
66+ labelsFile opts.ListOpts
67+ loggingOpts opts.ListOpts
68+ privileged bool
69+ pidMode string
70+ utsMode string
71+ usernsMode string
72+ cgroupnsMode string
73+ publishAll bool
74+ stdin bool
75+ tty bool
76+ oomKillDisable bool
77+ oomScoreAdj int
78+ containerIDFile string
79+ entrypoint string
80+ hostname string
81+ domainname string
82+ memory opts.MemBytes
83+ memoryReservation opts.MemBytes
84+ memorySwap opts.MemSwapBytes
85+ kernelMemory opts.MemBytes
86+ user string
87+ workingDir string
88+ cpuCount int64
89+ cpuShares int64
90+ cpuPercent int64
91+ cpuPeriod int64
92+ cpuRealtimePeriod int64
93+ cpuRealtimeRuntime int64
94+ cpuQuota int64
95+ cpus opts.NanoCPUs
96+ cpusetCpus string
97+ cpusetMems string
98+ blkioWeight uint16
99+ ioMaxBandwidth opts.MemBytes
100+ ioMaxIOps uint64
101+ swappiness int64
102+ netMode opts.NetworkOpt
103+ macAddress string
104+ ipv4Address string
105+ ipv6Address string
106+ ipcMode string
107+ pidsLimit int64
108+ restartPolicy string
109+ readonlyRootfs bool
110+ loggingDriver string
111+ cgroupParent string
112+ volumeDriver string
113+ stopSignal string
114+ stopTimeout int
115+ isolation string
116+ shmSize opts.MemBytes
117+ noHealthcheck bool
118+ healthCmd string
119+ healthInterval time.Duration
120+ healthTimeout time.Duration
121+ healthStartPeriod time.Duration
122+ healthStartInterval time.Duration
123+ healthRetries int
124+ runtime string
125+ autoRemove bool
126+ init bool
127+ annotations * opts.MapOpts
127128
128129 Image string
129130 Args []string
@@ -250,6 +251,8 @@ func addFlags(flags *pflag.FlagSet) *containerOptions {
250251 flags .DurationVar (& copts .healthTimeout , "health-timeout" , 0 , "Maximum time to allow one check to run (ms|s|m|h) (default 0s)" )
251252 flags .DurationVar (& copts .healthStartPeriod , "health-start-period" , 0 , "Start period for the container to initialize before starting health-retries countdown (ms|s|m|h) (default 0s)" )
252253 flags .SetAnnotation ("health-start-period" , "version" , []string {"1.29" })
254+ flags .DurationVar (& copts .healthStartInterval , "health-start-interval" , 0 , "Time between running the check during the start period (ms|s|m|h) (default 0s)" )
255+ flags .SetAnnotation ("health-start-interval" , "version" , []string {"1.44" })
253256 flags .BoolVar (& copts .noHealthcheck , "no-healthcheck" , false , "Disable any container-specified HEALTHCHECK" )
254257
255258 // Resource management
@@ -526,7 +529,8 @@ func parse(flags *pflag.FlagSet, copts *containerOptions, serverOS string) (*con
526529 copts .healthInterval != 0 ||
527530 copts .healthTimeout != 0 ||
528531 copts .healthStartPeriod != 0 ||
529- copts .healthRetries != 0
532+ copts .healthRetries != 0 ||
533+ copts .healthStartInterval != 0
530534 if copts .noHealthcheck {
531535 if haveHealthSettings {
532536 return nil , errors .Errorf ("--no-healthcheck conflicts with --health-* options" )
@@ -549,13 +553,17 @@ func parse(flags *pflag.FlagSet, copts *containerOptions, serverOS string) (*con
549553 if copts .healthStartPeriod < 0 {
550554 return nil , fmt .Errorf ("--health-start-period cannot be negative" )
551555 }
556+ if copts .healthStartInterval < 0 {
557+ return nil , fmt .Errorf ("--health-start-interval cannot be negative" )
558+ }
552559
553560 healthConfig = & container.HealthConfig {
554- Test : probe ,
555- Interval : copts .healthInterval ,
556- Timeout : copts .healthTimeout ,
557- StartPeriod : copts .healthStartPeriod ,
558- Retries : copts .healthRetries ,
561+ Test : probe ,
562+ Interval : copts .healthInterval ,
563+ Timeout : copts .healthTimeout ,
564+ StartPeriod : copts .healthStartPeriod ,
565+ StartInterval : copts .healthStartInterval ,
566+ Retries : copts .healthRetries ,
559567 }
560568 }
561569
0 commit comments