docker/cli ยท error
--%s conflicts with --health-* options
Error message
--%s conflicts with --health-* options
What it means
Error "--%s conflicts with --health-* options" thrown in docker/cli.
Source
Thrown at cli/command/service/opts.go:491
interval opts.PositiveDurationOpt
timeout opts.PositiveDurationOpt
retries int
startPeriod opts.PositiveDurationOpt
startInterval opts.PositiveDurationOpt
noHealthcheck bool
}
func (o *healthCheckOptions) toHealthConfig() (*container.HealthConfig, error) {
var healthConfig *container.HealthConfig
haveHealthSettings := o.cmd != "" ||
o.interval.Value() != nil ||
o.timeout.Value() != nil ||
o.startPeriod.Value() != nil ||
o.startInterval.Value() != nil ||
o.retries != 0
if o.noHealthcheck {
if haveHealthSettings {
return nil, fmt.Errorf("--%s conflicts with --health-* options", flagNoHealthcheck)
}
healthConfig = &container.HealthConfig{Test: []string{"NONE"}}
} else if haveHealthSettings {
var test []string
if o.cmd != "" {
test = []string{"CMD-SHELL", o.cmd}
}
var interval, timeout, startPeriod, startInterval time.Duration
if ptr := o.interval.Value(); ptr != nil {
interval = *ptr
}
if ptr := o.timeout.Value(); ptr != nil {
timeout = *ptr
}
if ptr := o.startPeriod.Value(); ptr != nil {
startPeriod = *ptr
}
if ptr := o.startInterval.Value(); ptr != nil {View on GitHub (pinned to e9452d6e78)
When it happens
Trigger: Thrown at cli/command/service/opts.go:491 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of docker/cli@e9452d6e78 (2026-08-01).
Data as JSON: /data/errors/348c695e2ee8d5e7.json.
Report an issue: GitHub.