diff options
author | Sebastiaan van Stijn <github@gone.nl> | 2022-10-17 12:47:25 +0200 |
---|---|---|
committer | Sebastiaan van Stijn <github@gone.nl> | 2022-10-17 15:15:55 +0200 |
commit | 17fb29c9e82771304531c071bce16bb8c431a110 (patch) | |
tree | 65049ebf5ef5a0be0b5a9c7c7e6010d19b368d18 /daemon/daemon.go | |
parent | d006242d737843977ca751711a13df77c813b0a0 (diff) | |
download | docker-17fb29c9e82771304531c071bce16bb8c431a110.tar.gz |
daemon: NewDaemon(): check system requirements early
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Diffstat (limited to 'daemon/daemon.go')
-rw-r--r-- | daemon/daemon.go | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/daemon/daemon.go b/daemon/daemon.go index 272ab6bc5c..313845395b 100644 --- a/daemon/daemon.go +++ b/daemon/daemon.go @@ -706,9 +706,10 @@ func (daemon *Daemon) IsSwarmCompatible() error { // NewDaemon sets up everything for the daemon to be able to service // requests from the webserver. func NewDaemon(ctx context.Context, config *config.Config, pluginStore *plugin.Store) (daemon *Daemon, err error) { - // Verify the platform is supported as a daemon - if !platformSupported { - return nil, errors.New("the Docker daemon is not supported on this platform") + // Verify platform-specific requirements. + // TODO(thaJeztah): this should be called before we try to create the daemon; perhaps together with the config validation. + if err := checkSystem(); err != nil { + return nil, err } registryService, err := registry.NewService(config.ServiceOptions) @@ -732,11 +733,6 @@ func NewDaemon(ctx context.Context, config *config.Config, pluginStore *plugin.S // Setup the resolv.conf setupResolvConf(config) - // Validate platform-specific requirements - if err := checkSystem(); err != nil { - return nil, err - } - idMapping, err := setupRemappedRoot(config) if err != nil { return nil, err |