(attach bool)
| 79 | } |
| 80 | |
| 81 | func (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 | |
| 104 | func (cr *containerReference) Pull(forcePull bool) common.Executor { |
| 105 | return common. |
nothing calls this directly
no test coverage detected