github.1485827954.workers.dev/nektos/act@v0.2.63/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 int64 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 } 58 59 // NewDockerBuildExecutorInput the input for the NewDockerBuildExecutor function 60 type NewDockerBuildExecutorInput struct { 61 ContextDir string 62 Dockerfile string 63 BuildContext io.Reader 64 ImageTag string 65 Platform string 66 } 67 68 // NewDockerPullExecutorInput the input for the NewDockerPullExecutor function 69 type NewDockerPullExecutorInput struct { 70 Image string 71 ForcePull bool 72 Platform string 73 Username string 74 Password string 75 }