Move CheckSystem() call to newDaemonCLI() for earlier validation
of platform-specific requirements.
Signed-off-by: hiroto.toyoda <hiroto.toyoda@dena.com>
| ... | ... |
@@ -93,6 +93,12 @@ func newDaemonCLI(opts *daemonOptions) (*daemonCLI, error) {
|
| 93 | 93 |
return nil, err |
| 94 | 94 |
} |
| 95 | 95 |
|
| 96 |
+ // Verify platform-specific requirements. |
|
| 97 |
+ // This is checked early so that `dockerd --validate` also validates system requirements. |
|
| 98 |
+ if err := daemon.CheckSystem(); err != nil {
|
|
| 99 |
+ return nil, fmt.Errorf("system requirements not met: %w", err)
|
|
| 100 |
+ } |
|
| 101 |
+ |
|
| 96 | 102 |
return &daemonCLI{
|
| 97 | 103 |
Config: cfg, |
| 98 | 104 |
configFile: &opts.configFile, |
| ... | ... |
@@ -114,11 +120,6 @@ func (cli *daemonCLI) start(ctx context.Context) (err error) {
|
| 114 | 114 |
debug.Enable() |
| 115 | 115 |
} |
| 116 | 116 |
|
| 117 |
- // Verify platform-specific requirements before proceeding with daemon initialization |
|
| 118 |
- if err := daemon.CheckSystem(); err != nil {
|
|
| 119 |
- return fmt.Errorf("system requirements not met: %w", err)
|
|
| 120 |
- } |
|
| 121 |
- |
|
| 122 | 117 |
if rootless.RunningWithRootlessKit() && !cli.Config.IsRootless() {
|
| 123 | 118 |
return errors.New("rootless mode needs to be enabled for running with RootlessKit")
|
| 124 | 119 |
} |