-
Notifications
You must be signed in to change notification settings - Fork 5
/
common.go
44 lines (33 loc) · 876 Bytes
/
common.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package docker
import (
"context"
"errors"
"github.com/defang-io/defang/src/pkg/types"
"github.com/docker/docker/client"
)
type ContainerID = types.TaskID
type Docker struct {
*client.Client
image string
memory uint64
platform string
}
func New() *Docker {
cli, err := client.NewClientWithOpts(client.FromEnv, client.WithAPIVersionNegotiation())
if err != nil {
panic(err)
}
return &Docker{
Client: cli,
}
}
var _ types.Driver = (*Docker)(nil)
func (Docker) PutSecret(ctx context.Context, name, value string) error {
return errors.New("docker does not support secrets")
}
func (Docker) ListSecrets(ctx context.Context) ([]string, error) {
return nil, errors.New("docker does not support secrets")
}
func (Docker) CreateUploadURL(ctx context.Context, name string) (string, error) {
return "", errors.New("docker does not support uploads")
}