opts.go 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596
  1. package service
  2. import (
  3. "errors"
  4. "fmt"
  5. "strconv"
  6. "strings"
  7. "time"
  8. "github.com/docker/docker/api/types/container"
  9. "github.com/docker/docker/api/types/swarm"
  10. "github.com/docker/docker/opts"
  11. runconfigopts "github.com/docker/docker/runconfig/opts"
  12. "github.com/spf13/cobra"
  13. )
  14. type int64Value interface {
  15. Value() int64
  16. }
  17. // PositiveDurationOpt is an option type for time.Duration that uses a pointer.
  18. // It bahave similarly to DurationOpt but only allows positive duration values.
  19. type PositiveDurationOpt struct {
  20. DurationOpt
  21. }
  22. // Set a new value on the option. Setting a negative duration value will cause
  23. // an error to be returned.
  24. func (d *PositiveDurationOpt) Set(s string) error {
  25. err := d.DurationOpt.Set(s)
  26. if err != nil {
  27. return err
  28. }
  29. if *d.DurationOpt.value < 0 {
  30. return fmt.Errorf("duration cannot be negative")
  31. }
  32. return nil
  33. }
  34. // DurationOpt is an option type for time.Duration that uses a pointer. This
  35. // allows us to get nil values outside, instead of defaulting to 0
  36. type DurationOpt struct {
  37. value *time.Duration
  38. }
  39. // Set a new value on the option
  40. func (d *DurationOpt) Set(s string) error {
  41. v, err := time.ParseDuration(s)
  42. d.value = &v
  43. return err
  44. }
  45. // Type returns the type of this option, which will be displayed in `--help` output
  46. func (d *DurationOpt) Type() string {
  47. return "duration"
  48. }
  49. // String returns a string repr of this option
  50. func (d *DurationOpt) String() string {
  51. if d.value != nil {
  52. return d.value.String()
  53. }
  54. return ""
  55. }
  56. // Value returns the time.Duration
  57. func (d *DurationOpt) Value() *time.Duration {
  58. return d.value
  59. }
  60. // Uint64Opt represents a uint64.
  61. type Uint64Opt struct {
  62. value *uint64
  63. }
  64. // Set a new value on the option
  65. func (i *Uint64Opt) Set(s string) error {
  66. v, err := strconv.ParseUint(s, 0, 64)
  67. i.value = &v
  68. return err
  69. }
  70. // Type returns the type of this option, which will be displayed in `--help` output
  71. func (i *Uint64Opt) Type() string {
  72. return "uint"
  73. }
  74. // String returns a string repr of this option
  75. func (i *Uint64Opt) String() string {
  76. if i.value != nil {
  77. return fmt.Sprintf("%v", *i.value)
  78. }
  79. return ""
  80. }
  81. // Value returns the uint64
  82. func (i *Uint64Opt) Value() *uint64 {
  83. return i.value
  84. }
  85. type floatValue float32
  86. func (f *floatValue) Set(s string) error {
  87. v, err := strconv.ParseFloat(s, 32)
  88. *f = floatValue(v)
  89. return err
  90. }
  91. func (f *floatValue) Type() string {
  92. return "float"
  93. }
  94. func (f *floatValue) String() string {
  95. return strconv.FormatFloat(float64(*f), 'g', -1, 32)
  96. }
  97. func (f *floatValue) Value() float32 {
  98. return float32(*f)
  99. }
  100. // placementPrefOpts holds a list of placement preferences.
  101. type placementPrefOpts struct {
  102. prefs []swarm.PlacementPreference
  103. strings []string
  104. }
  105. func (opts *placementPrefOpts) String() string {
  106. if len(opts.strings) == 0 {
  107. return ""
  108. }
  109. return fmt.Sprintf("%v", opts.strings)
  110. }
  111. // Set validates the input value and adds it to the internal slices.
  112. // Note: in the future strategies other than "spread", may be supported,
  113. // as well as additional comma-separated options.
  114. func (opts *placementPrefOpts) Set(value string) error {
  115. fields := strings.Split(value, "=")
  116. if len(fields) != 2 {
  117. return errors.New(`placement preference must be of the format "<strategy>=<arg>"`)
  118. }
  119. if fields[0] != "spread" {
  120. return fmt.Errorf("unsupported placement preference %s (only spread is supported)", fields[0])
  121. }
  122. opts.prefs = append(opts.prefs, swarm.PlacementPreference{
  123. Spread: &swarm.SpreadOver{
  124. SpreadDescriptor: fields[1],
  125. },
  126. })
  127. opts.strings = append(opts.strings, value)
  128. return nil
  129. }
  130. // Type returns a string name for this Option type
  131. func (opts *placementPrefOpts) Type() string {
  132. return "pref"
  133. }
  134. type updateOptions struct {
  135. parallelism uint64
  136. delay time.Duration
  137. monitor time.Duration
  138. onFailure string
  139. maxFailureRatio floatValue
  140. }
  141. type resourceOptions struct {
  142. limitCPU opts.NanoCPUs
  143. limitMemBytes opts.MemBytes
  144. resCPU opts.NanoCPUs
  145. resMemBytes opts.MemBytes
  146. }
  147. func (r *resourceOptions) ToResourceRequirements() *swarm.ResourceRequirements {
  148. return &swarm.ResourceRequirements{
  149. Limits: &swarm.Resources{
  150. NanoCPUs: r.limitCPU.Value(),
  151. MemoryBytes: r.limitMemBytes.Value(),
  152. },
  153. Reservations: &swarm.Resources{
  154. NanoCPUs: r.resCPU.Value(),
  155. MemoryBytes: r.resMemBytes.Value(),
  156. },
  157. }
  158. }
  159. type restartPolicyOptions struct {
  160. condition string
  161. delay DurationOpt
  162. maxAttempts Uint64Opt
  163. window DurationOpt
  164. }
  165. func (r *restartPolicyOptions) ToRestartPolicy() *swarm.RestartPolicy {
  166. return &swarm.RestartPolicy{
  167. Condition: swarm.RestartPolicyCondition(r.condition),
  168. Delay: r.delay.Value(),
  169. MaxAttempts: r.maxAttempts.Value(),
  170. Window: r.window.Value(),
  171. }
  172. }
  173. func convertNetworks(networks []string) []swarm.NetworkAttachmentConfig {
  174. nets := []swarm.NetworkAttachmentConfig{}
  175. for _, network := range networks {
  176. nets = append(nets, swarm.NetworkAttachmentConfig{Target: network})
  177. }
  178. return nets
  179. }
  180. type endpointOptions struct {
  181. mode string
  182. publishPorts opts.PortOpt
  183. }
  184. func (e *endpointOptions) ToEndpointSpec() *swarm.EndpointSpec {
  185. return &swarm.EndpointSpec{
  186. Mode: swarm.ResolutionMode(strings.ToLower(e.mode)),
  187. Ports: e.publishPorts.Value(),
  188. }
  189. }
  190. type logDriverOptions struct {
  191. name string
  192. opts opts.ListOpts
  193. }
  194. func newLogDriverOptions() logDriverOptions {
  195. return logDriverOptions{opts: opts.NewListOpts(opts.ValidateEnv)}
  196. }
  197. func (ldo *logDriverOptions) toLogDriver() *swarm.Driver {
  198. if ldo.name == "" {
  199. return nil
  200. }
  201. // set the log driver only if specified.
  202. return &swarm.Driver{
  203. Name: ldo.name,
  204. Options: runconfigopts.ConvertKVStringsToMap(ldo.opts.GetAll()),
  205. }
  206. }
  207. type healthCheckOptions struct {
  208. cmd string
  209. interval PositiveDurationOpt
  210. timeout PositiveDurationOpt
  211. retries int
  212. noHealthcheck bool
  213. }
  214. func (opts *healthCheckOptions) toHealthConfig() (*container.HealthConfig, error) {
  215. var healthConfig *container.HealthConfig
  216. haveHealthSettings := opts.cmd != "" ||
  217. opts.interval.Value() != nil ||
  218. opts.timeout.Value() != nil ||
  219. opts.retries != 0
  220. if opts.noHealthcheck {
  221. if haveHealthSettings {
  222. return nil, fmt.Errorf("--%s conflicts with --health-* options", flagNoHealthcheck)
  223. }
  224. healthConfig = &container.HealthConfig{Test: []string{"NONE"}}
  225. } else if haveHealthSettings {
  226. var test []string
  227. if opts.cmd != "" {
  228. test = []string{"CMD-SHELL", opts.cmd}
  229. }
  230. var interval, timeout time.Duration
  231. if ptr := opts.interval.Value(); ptr != nil {
  232. interval = *ptr
  233. }
  234. if ptr := opts.timeout.Value(); ptr != nil {
  235. timeout = *ptr
  236. }
  237. healthConfig = &container.HealthConfig{
  238. Test: test,
  239. Interval: interval,
  240. Timeout: timeout,
  241. Retries: opts.retries,
  242. }
  243. }
  244. return healthConfig, nil
  245. }
  246. // convertExtraHostsToSwarmHosts converts an array of extra hosts in cli
  247. // <host>:<ip>
  248. // into a swarmkit host format:
  249. // IP_address canonical_hostname [aliases...]
  250. // This assumes input value (<host>:<ip>) has already been validated
  251. func convertExtraHostsToSwarmHosts(extraHosts []string) []string {
  252. hosts := []string{}
  253. for _, extraHost := range extraHosts {
  254. parts := strings.SplitN(extraHost, ":", 2)
  255. hosts = append(hosts, fmt.Sprintf("%s %s", parts[1], parts[0]))
  256. }
  257. return hosts
  258. }
  259. type serviceOptions struct {
  260. name string
  261. labels opts.ListOpts
  262. containerLabels opts.ListOpts
  263. image string
  264. args []string
  265. hostname string
  266. env opts.ListOpts
  267. envFile opts.ListOpts
  268. workdir string
  269. user string
  270. groups opts.ListOpts
  271. stopSignal string
  272. tty bool
  273. readOnly bool
  274. mounts opts.MountOpt
  275. dns opts.ListOpts
  276. dnsSearch opts.ListOpts
  277. dnsOption opts.ListOpts
  278. hosts opts.ListOpts
  279. resources resourceOptions
  280. stopGrace DurationOpt
  281. replicas Uint64Opt
  282. mode string
  283. restartPolicy restartPolicyOptions
  284. constraints opts.ListOpts
  285. placementPrefs placementPrefOpts
  286. update updateOptions
  287. networks opts.ListOpts
  288. endpoint endpointOptions
  289. registryAuth bool
  290. logDriver logDriverOptions
  291. healthcheck healthCheckOptions
  292. secrets opts.SecretOpt
  293. }
  294. func newServiceOptions() *serviceOptions {
  295. return &serviceOptions{
  296. labels: opts.NewListOpts(opts.ValidateEnv),
  297. constraints: opts.NewListOpts(nil),
  298. containerLabels: opts.NewListOpts(opts.ValidateEnv),
  299. env: opts.NewListOpts(opts.ValidateEnv),
  300. envFile: opts.NewListOpts(nil),
  301. groups: opts.NewListOpts(nil),
  302. logDriver: newLogDriverOptions(),
  303. dns: opts.NewListOpts(opts.ValidateIPAddress),
  304. dnsOption: opts.NewListOpts(nil),
  305. dnsSearch: opts.NewListOpts(opts.ValidateDNSSearch),
  306. hosts: opts.NewListOpts(opts.ValidateExtraHost),
  307. networks: opts.NewListOpts(nil),
  308. }
  309. }
  310. func (opts *serviceOptions) ToServiceMode() (swarm.ServiceMode, error) {
  311. serviceMode := swarm.ServiceMode{}
  312. switch opts.mode {
  313. case "global":
  314. if opts.replicas.Value() != nil {
  315. return serviceMode, fmt.Errorf("replicas can only be used with replicated mode")
  316. }
  317. serviceMode.Global = &swarm.GlobalService{}
  318. case "replicated":
  319. serviceMode.Replicated = &swarm.ReplicatedService{
  320. Replicas: opts.replicas.Value(),
  321. }
  322. default:
  323. return serviceMode, fmt.Errorf("Unknown mode: %s, only replicated and global supported", opts.mode)
  324. }
  325. return serviceMode, nil
  326. }
  327. func (opts *serviceOptions) ToService() (swarm.ServiceSpec, error) {
  328. var service swarm.ServiceSpec
  329. envVariables, err := runconfigopts.ReadKVStrings(opts.envFile.GetAll(), opts.env.GetAll())
  330. if err != nil {
  331. return service, err
  332. }
  333. currentEnv := make([]string, 0, len(envVariables))
  334. for _, env := range envVariables { // need to process each var, in order
  335. k := strings.SplitN(env, "=", 2)[0]
  336. for i, current := range currentEnv { // remove duplicates
  337. if current == env {
  338. continue // no update required, may hide this behind flag to preserve order of envVariables
  339. }
  340. if strings.HasPrefix(current, k+"=") {
  341. currentEnv = append(currentEnv[:i], currentEnv[i+1:]...)
  342. }
  343. }
  344. currentEnv = append(currentEnv, env)
  345. }
  346. healthConfig, err := opts.healthcheck.toHealthConfig()
  347. if err != nil {
  348. return service, err
  349. }
  350. serviceMode, err := opts.ToServiceMode()
  351. if err != nil {
  352. return service, err
  353. }
  354. service = swarm.ServiceSpec{
  355. Annotations: swarm.Annotations{
  356. Name: opts.name,
  357. Labels: runconfigopts.ConvertKVStringsToMap(opts.labels.GetAll()),
  358. },
  359. TaskTemplate: swarm.TaskSpec{
  360. ContainerSpec: swarm.ContainerSpec{
  361. Image: opts.image,
  362. Args: opts.args,
  363. Env: currentEnv,
  364. Hostname: opts.hostname,
  365. Labels: runconfigopts.ConvertKVStringsToMap(opts.containerLabels.GetAll()),
  366. Dir: opts.workdir,
  367. User: opts.user,
  368. Groups: opts.groups.GetAll(),
  369. StopSignal: opts.stopSignal,
  370. TTY: opts.tty,
  371. ReadOnly: opts.readOnly,
  372. Mounts: opts.mounts.Value(),
  373. DNSConfig: &swarm.DNSConfig{
  374. Nameservers: opts.dns.GetAll(),
  375. Search: opts.dnsSearch.GetAll(),
  376. Options: opts.dnsOption.GetAll(),
  377. },
  378. Hosts: convertExtraHostsToSwarmHosts(opts.hosts.GetAll()),
  379. StopGracePeriod: opts.stopGrace.Value(),
  380. Secrets: nil,
  381. Healthcheck: healthConfig,
  382. },
  383. Networks: convertNetworks(opts.networks.GetAll()),
  384. Resources: opts.resources.ToResourceRequirements(),
  385. RestartPolicy: opts.restartPolicy.ToRestartPolicy(),
  386. Placement: &swarm.Placement{
  387. Constraints: opts.constraints.GetAll(),
  388. Preferences: opts.placementPrefs.prefs,
  389. },
  390. LogDriver: opts.logDriver.toLogDriver(),
  391. },
  392. Networks: convertNetworks(opts.networks.GetAll()),
  393. Mode: serviceMode,
  394. UpdateConfig: &swarm.UpdateConfig{
  395. Parallelism: opts.update.parallelism,
  396. Delay: opts.update.delay,
  397. Monitor: opts.update.monitor,
  398. FailureAction: opts.update.onFailure,
  399. MaxFailureRatio: opts.update.maxFailureRatio.Value(),
  400. },
  401. EndpointSpec: opts.endpoint.ToEndpointSpec(),
  402. }
  403. return service, nil
  404. }
  405. // addServiceFlags adds all flags that are common to both `create` and `update`.
  406. // Any flags that are not common are added separately in the individual command
  407. func addServiceFlags(cmd *cobra.Command, opts *serviceOptions) {
  408. flags := cmd.Flags()
  409. flags.StringVarP(&opts.workdir, flagWorkdir, "w", "", "Working directory inside the container")
  410. flags.StringVarP(&opts.user, flagUser, "u", "", "Username or UID (format: <name|uid>[:<group|gid>])")
  411. flags.StringVar(&opts.hostname, flagHostname, "", "Container hostname")
  412. flags.SetAnnotation(flagHostname, "version", []string{"1.25"})
  413. flags.Var(&opts.resources.limitCPU, flagLimitCPU, "Limit CPUs")
  414. flags.Var(&opts.resources.limitMemBytes, flagLimitMemory, "Limit Memory")
  415. flags.Var(&opts.resources.resCPU, flagReserveCPU, "Reserve CPUs")
  416. flags.Var(&opts.resources.resMemBytes, flagReserveMemory, "Reserve Memory")
  417. flags.Var(&opts.stopGrace, flagStopGracePeriod, "Time to wait before force killing a container (ns|us|ms|s|m|h)")
  418. flags.Var(&opts.replicas, flagReplicas, "Number of tasks")
  419. flags.StringVar(&opts.restartPolicy.condition, flagRestartCondition, "", `Restart when condition is met ("none"|"on-failure"|"any")`)
  420. flags.Var(&opts.restartPolicy.delay, flagRestartDelay, "Delay between restart attempts (ns|us|ms|s|m|h)")
  421. flags.Var(&opts.restartPolicy.maxAttempts, flagRestartMaxAttempts, "Maximum number of restarts before giving up")
  422. flags.Var(&opts.restartPolicy.window, flagRestartWindow, "Window used to evaluate the restart policy (ns|us|ms|s|m|h)")
  423. flags.Uint64Var(&opts.update.parallelism, flagUpdateParallelism, 1, "Maximum number of tasks updated simultaneously (0 to update all at once)")
  424. flags.DurationVar(&opts.update.delay, flagUpdateDelay, time.Duration(0), "Delay between updates (ns|us|ms|s|m|h) (default 0s)")
  425. flags.DurationVar(&opts.update.monitor, flagUpdateMonitor, time.Duration(0), "Duration after each task update to monitor for failure (ns|us|ms|s|m|h) (default 0s)")
  426. flags.SetAnnotation(flagUpdateMonitor, "version", []string{"1.25"})
  427. flags.StringVar(&opts.update.onFailure, flagUpdateFailureAction, "pause", `Action on update failure ("pause"|"continue"|"rollback")`)
  428. flags.Var(&opts.update.maxFailureRatio, flagUpdateMaxFailureRatio, "Failure rate to tolerate during an update")
  429. flags.SetAnnotation(flagUpdateMaxFailureRatio, "version", []string{"1.25"})
  430. flags.StringVar(&opts.endpoint.mode, flagEndpointMode, "vip", "Endpoint mode (vip or dnsrr)")
  431. flags.BoolVar(&opts.registryAuth, flagRegistryAuth, false, "Send registry authentication details to swarm agents")
  432. flags.StringVar(&opts.logDriver.name, flagLogDriver, "", "Logging driver for service")
  433. flags.Var(&opts.logDriver.opts, flagLogOpt, "Logging driver options")
  434. flags.StringVar(&opts.healthcheck.cmd, flagHealthCmd, "", "Command to run to check health")
  435. flags.SetAnnotation(flagHealthCmd, "version", []string{"1.25"})
  436. flags.Var(&opts.healthcheck.interval, flagHealthInterval, "Time between running the check (ns|us|ms|s|m|h)")
  437. flags.SetAnnotation(flagHealthInterval, "version", []string{"1.25"})
  438. flags.Var(&opts.healthcheck.timeout, flagHealthTimeout, "Maximum time to allow one check to run (ns|us|ms|s|m|h)")
  439. flags.SetAnnotation(flagHealthTimeout, "version", []string{"1.25"})
  440. flags.IntVar(&opts.healthcheck.retries, flagHealthRetries, 0, "Consecutive failures needed to report unhealthy")
  441. flags.SetAnnotation(flagHealthRetries, "version", []string{"1.25"})
  442. flags.BoolVar(&opts.healthcheck.noHealthcheck, flagNoHealthcheck, false, "Disable any container-specified HEALTHCHECK")
  443. flags.SetAnnotation(flagNoHealthcheck, "version", []string{"1.25"})
  444. flags.BoolVarP(&opts.tty, flagTTY, "t", false, "Allocate a pseudo-TTY")
  445. flags.SetAnnotation(flagTTY, "version", []string{"1.25"})
  446. flags.BoolVar(&opts.readOnly, flagReadOnly, false, "Mount the container's root filesystem as read only")
  447. flags.SetAnnotation(flagReadOnly, "version", []string{"1.27"})
  448. flags.StringVar(&opts.stopSignal, flagStopSignal, "", "Signal to stop the container")
  449. flags.SetAnnotation(flagStopSignal, "version", []string{"1.27"})
  450. }
  451. const (
  452. flagPlacementPref = "placement-pref"
  453. flagPlacementPrefAdd = "placement-pref-add"
  454. flagPlacementPrefRemove = "placement-pref-rm"
  455. flagConstraint = "constraint"
  456. flagConstraintRemove = "constraint-rm"
  457. flagConstraintAdd = "constraint-add"
  458. flagContainerLabel = "container-label"
  459. flagContainerLabelRemove = "container-label-rm"
  460. flagContainerLabelAdd = "container-label-add"
  461. flagDNS = "dns"
  462. flagDNSRemove = "dns-rm"
  463. flagDNSAdd = "dns-add"
  464. flagDNSOption = "dns-option"
  465. flagDNSOptionRemove = "dns-option-rm"
  466. flagDNSOptionAdd = "dns-option-add"
  467. flagDNSSearch = "dns-search"
  468. flagDNSSearchRemove = "dns-search-rm"
  469. flagDNSSearchAdd = "dns-search-add"
  470. flagEndpointMode = "endpoint-mode"
  471. flagHost = "host"
  472. flagHostAdd = "host-add"
  473. flagHostRemove = "host-rm"
  474. flagHostname = "hostname"
  475. flagEnv = "env"
  476. flagEnvFile = "env-file"
  477. flagEnvRemove = "env-rm"
  478. flagEnvAdd = "env-add"
  479. flagGroup = "group"
  480. flagGroupAdd = "group-add"
  481. flagGroupRemove = "group-rm"
  482. flagLabel = "label"
  483. flagLabelRemove = "label-rm"
  484. flagLabelAdd = "label-add"
  485. flagLimitCPU = "limit-cpu"
  486. flagLimitMemory = "limit-memory"
  487. flagMode = "mode"
  488. flagMount = "mount"
  489. flagMountRemove = "mount-rm"
  490. flagMountAdd = "mount-add"
  491. flagName = "name"
  492. flagNetwork = "network"
  493. flagPublish = "publish"
  494. flagPublishRemove = "publish-rm"
  495. flagPublishAdd = "publish-add"
  496. flagReadOnly = "read-only"
  497. flagReplicas = "replicas"
  498. flagReserveCPU = "reserve-cpu"
  499. flagReserveMemory = "reserve-memory"
  500. flagRestartCondition = "restart-condition"
  501. flagRestartDelay = "restart-delay"
  502. flagRestartMaxAttempts = "restart-max-attempts"
  503. flagRestartWindow = "restart-window"
  504. flagStopGracePeriod = "stop-grace-period"
  505. flagStopSignal = "stop-signal"
  506. flagTTY = "tty"
  507. flagUpdateDelay = "update-delay"
  508. flagUpdateFailureAction = "update-failure-action"
  509. flagUpdateMaxFailureRatio = "update-max-failure-ratio"
  510. flagUpdateMonitor = "update-monitor"
  511. flagUpdateParallelism = "update-parallelism"
  512. flagUser = "user"
  513. flagWorkdir = "workdir"
  514. flagRegistryAuth = "with-registry-auth"
  515. flagLogDriver = "log-driver"
  516. flagLogOpt = "log-opt"
  517. flagHealthCmd = "health-cmd"
  518. flagHealthInterval = "health-interval"
  519. flagHealthRetries = "health-retries"
  520. flagHealthTimeout = "health-timeout"
  521. flagNoHealthcheck = "no-healthcheck"
  522. flagSecret = "secret"
  523. flagSecretAdd = "secret-add"
  524. flagSecretRemove = "secret-rm"
  525. )