mirror of
https://github.com/hanzoai/runtime.git
synced 2026-10-30 18:23:13 +00:00
- Add main Dockerfile for production builds - Add Dockerfile.runtime for secure code execution - Add Dockerfile.runtime.fixed with improved configuration - Include .dockerignore for build optimization - Add integration documentation and publishing guides - Update API and CLI components for better runtime support - Enhance sandbox and container management features
54 lines
1.5 KiB
Go
54 lines
1.5 KiB
Go
// Copyright 2025 Hanzo Industries Inc.
|
|
// SPDX-License-Identifier: AGPL-3.0
|
|
|
|
package docker
|
|
|
|
import (
|
|
"io"
|
|
"sync"
|
|
|
|
"github.com/hanzoai/runner/pkg/cache"
|
|
"github.com/docker/docker/client"
|
|
)
|
|
|
|
type DockerClientConfig struct {
|
|
ApiClient client.APIClient
|
|
Cache cache.IRunnerCache
|
|
LogWriter io.Writer
|
|
AWSRegion string
|
|
AWSEndpointUrl string
|
|
AWSAccessKeyId string
|
|
AWSSecretAccessKey string
|
|
DaemonPath string
|
|
ComputerUsePluginPath string
|
|
}
|
|
|
|
func NewDockerClient(config DockerClientConfig) *DockerClient {
|
|
return &DockerClient{
|
|
apiClient: config.ApiClient,
|
|
cache: config.Cache,
|
|
logWriter: config.LogWriter,
|
|
awsRegion: config.AWSRegion,
|
|
awsEndpointUrl: config.AWSEndpointUrl,
|
|
awsAccessKeyId: config.AWSAccessKeyId,
|
|
awsSecretAccessKey: config.AWSSecretAccessKey,
|
|
volumeMutexes: make(map[string]*sync.Mutex),
|
|
daemonPath: config.DaemonPath,
|
|
computerUsePluginPath: config.ComputerUsePluginPath,
|
|
}
|
|
}
|
|
|
|
type DockerClient struct {
|
|
apiClient client.APIClient
|
|
cache cache.IRunnerCache
|
|
logWriter io.Writer
|
|
awsRegion string
|
|
awsEndpointUrl string
|
|
awsAccessKeyId string
|
|
awsSecretAccessKey string
|
|
volumeMutexes map[string]*sync.Mutex
|
|
volumeMutexesMutex sync.Mutex
|
|
daemonPath string
|
|
computerUsePluginPath string
|
|
}
|