MCPcopy
hub / github.com/nektos/act / Start

Method Start

pkg/container/docker_run.go:81–102  ·  view source on GitHub ↗
(attach bool)

Source from the content-addressed store, hash-verified

79}
80
81func (cr *containerReference) Start(attach bool) common.Executor {
82 return common.
83 NewInfoExecutor("%sdocker run image=%s platform=%s entrypoint=%+q cmd=%+q network=%+q", logPrefix, cr.input.Image, cr.input.Platform, cr.input.Entrypoint, cr.input.Cmd, cr.input.NetworkMode).
84 Then(
85 common.NewPipelineExecutor(
86 cr.connect(),
87 cr.find(),
88 cr.attach().IfBool(attach),
89 cr.start(),
90 cr.wait().IfBool(attach),
91 cr.tryReadUID(),
92 cr.tryReadGID(),
93 func(ctx context.Context) error {
94 // If this fails, then folders have wrong permissions on non root container
95 if cr.UID != 0 || cr.GID != 0 {
96 _ = cr.Exec([]string{"chown", "-R", fmt.Sprintf("%d:%d", cr.UID, cr.GID), cr.input.WorkingDir}, nil, "0", "")(ctx)
97 }
98 return nil
99 },
100 ).IfNot(common.Dryrun),
101 )
102}
103
104func (cr *containerReference) Pull(forcePull bool) common.Executor {
105 return common.

Callers

nothing calls this directly

Calls 13

connectMethod · 0.95
findMethod · 0.95
attachMethod · 0.95
startMethod · 0.95
waitMethod · 0.95
tryReadUIDMethod · 0.95
tryReadGIDMethod · 0.95
ExecMethod · 0.95
NewInfoExecutorFunction · 0.92
NewPipelineExecutorFunction · 0.92
ThenMethod · 0.80
IfNotMethod · 0.80

Tested by

no test coverage detected