added docker instance manager constructor
This commit is contained in:
parent
9f19744dce
commit
dee532927b
@ -552,3 +552,17 @@ func (self *InstanceManager) StopFileBrowser(ctx context.Context, serverId strin
|
|||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func NewInstanceManager(config models.DockerInstanceManagerConfig) (*InstanceManager, error) {
|
||||||
|
apiClient, err := client.NewClientWithOpts(client.FromEnv, client.WithAPIVersionNegotiation())
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
defer apiClient.Close()
|
||||||
|
|
||||||
|
return &InstanceManager{
|
||||||
|
config: config,
|
||||||
|
client: *apiClient,
|
||||||
|
}, nil
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user