github.com/nektos/act@v0.2.83/pkg/container/container_types.go (about) 1 package container 2 3 import ( 4 "context" 5 "io" 6 7 "github.com/docker/go-connections/nat" 8 "github.com/nektos/act/pkg/common" 9 ) 10 11 // NewContainerInput the input for the New function 12 type NewContainerInput struct { 13 Image string 14 Username string 15 Password string 16 Entrypoint []string 17 Cmd []string 18 WorkingDir string 19 Env []string 20 Binds []string 21 Mounts map[string]string 22 Name string 23 Stdout io.Writer 24 Stderr io.Writer 25 NetworkMode string 26 Privileged bool 27 UsernsMode string 28 Platform string 29 Options string 30 NetworkAliases []string 31 ExposedPorts nat.PortSet 32 PortBindings nat.PortMap 33 } 34 35 // FileEntry is a file to copy to a container 36 type FileEntry struct { 37 Name string 38 Mode uint32 39 Body string 40 } 41 42 // Container for managing docker run containers 43 type Container interface { 44 Create(capAdd []string, capDrop []string) common.Executor 45 Copy(destPath string, files ...*FileEntry) common.Executor 46 CopyTarStream(ctx context.Context, destPath string, tarStream io.Reader) error 47 CopyDir(destPath string, srcPath string, useGitIgnore bool) common.Executor 48 GetContainerArchive(ctx context.Context, srcPath string) (io.ReadCloser, error) 49 Pull(forcePull bool) common.Executor 50 Start(attach bool) common.Executor 51 Exec(command []string, env map[string]string, user, workdir string) common.Executor 52 UpdateFromEnv(srcPath string, env *map[string]string) common.Executor 53 UpdateFromImageEnv(env *map[string]string) common.Executor 54 Remove() common.Executor 55 Close() common.Executor 56 ReplaceLogWriter(io.Writer, io.Writer) (io.Writer, io.Writer) 57 GetHealth(ctx context.Context) Health 58 } 59 60 // NewDockerBuildExecutorInput the input for the NewDockerBuildExecutor function 61 type NewDockerBuildExecutorInput struct { 62 ContextDir string 63 Dockerfile string 64 BuildContext io.Reader 65 ImageTag string 66 Platform string 67 } 68 69 // NewDockerPullExecutorInput the input for the NewDockerPullExecutor function 70 type NewDockerPullExecutorInput struct { 71 Image string 72 ForcePull bool 73 Platform string 74 Username string 75 Password string 76 } 77 78 type Health int 79 80 const ( 81 HealthStarting Health = iota 82 HealthHealthy 83 HealthUnHealthy 84 )