/
interface.go
66 lines (52 loc) · 1.86 KB
/
interface.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
package container_backend
import (
"context"
"io"
"github.com/werf/werf/pkg/image"
)
type CommonOpts struct{}
type TagOpts struct {
CommonOpts
}
type PushOpts struct {
CommonOpts
}
type PullOpts struct {
CommonOpts
}
type RmiOpts struct {
CommonOpts
}
type GetImageInfoOpts struct {
CommonOpts
}
type BuildDockerfileOpts struct {
CommonOpts
ContextTar io.ReadCloser
DockerfileCtxRelPath string // TODO: remove this and instead write the []byte dockerfile to /Dockerfile in the ContextTar inDockerServerBackend.BuildDockerfile().
Target string
BuildArgs []string // {"key1=value1", "key2=value2", ... }
AddHost []string
Network string
SSH string
Labels []string
Tags []string
}
type ContainerBackend interface {
Tag(ctx context.Context, ref, newRef string, opts TagOpts) error
Push(ctx context.Context, ref string, opts PushOpts) error
Pull(ctx context.Context, ref string, opts PullOpts) error
Rmi(ctx context.Context, ref string, opts RmiOpts) error
GetImageInfo(ctx context.Context, ref string, opts GetImageInfoOpts) (*image.Info, error)
BuildDockerfile(ctx context.Context, dockerfile []byte, opts BuildDockerfileOpts) (string, error)
BuildStapelStage(ctx context.Context, opts BuildStapelStageOptions) (string, error)
CalculateDependencyImportChecksum(ctx context.Context, dependencyImport DependencyImportSpec) (string, error)
HasStapelBuildSupport() bool
String() string
// Legacy
ShouldCleanupDockerfileImage() bool
RefreshImageObject(ctx context.Context, img LegacyImageInterface) error
PullImageFromRegistry(ctx context.Context, img LegacyImageInterface) error
RenameImage(ctx context.Context, img LegacyImageInterface, newImageName string, removeOldName bool) error
RemoveImage(ctx context.Context, img LegacyImageInterface) error
}