Skip to content

Commit

Permalink
Merge pull request #980 from AkihiroSuda/no-pivot
Browse files Browse the repository at this point in the history
runexecutor: support NoPivot
  • Loading branch information
tonistiigi committed May 7, 2019
2 parents 89851c6 + eba3ffc commit bec5b3e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion executor/runcexecutor/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ type Opt struct {
// ProcessMode
ProcessMode oci.ProcessMode
IdentityMapping *idtools.IdentityMapping
// runc run --no-pivot (unrecommended)
NoPivot bool
}

var defaultCommandCandidates = []string{"buildkit-runc", "runc"}
Expand All @@ -54,6 +56,7 @@ type runcExecutor struct {
networkProviders map[pb.NetMode]network.Provider
processMode oci.ProcessMode
idmap *idtools.IdentityMapping
noPivot bool
}

func New(opt Opt, networkProviders map[pb.NetMode]network.Provider) (executor.Executor, error) {
Expand Down Expand Up @@ -111,6 +114,7 @@ func New(opt Opt, networkProviders map[pb.NetMode]network.Provider) (executor.Ex
networkProviders: networkProviders,
processMode: opt.ProcessMode,
idmap: opt.IdentityMapping,
noPivot: opt.NoPivot,
}
return w, nil
}
Expand Down Expand Up @@ -269,7 +273,8 @@ func (w *runcExecutor) Exec(ctx context.Context, meta executor.Meta, root cache.

logrus.Debugf("> creating %s %v", id, meta.Args)
status, err := w.runc.Run(runCtx, id, bundle, &runc.CreateOpts{
IO: &forwardIO{stdin: stdin, stdout: stdout, stderr: stderr},
IO: &forwardIO{stdin: stdin, stdout: stdout, stderr: stderr},
NoPivot: w.noPivot,
})
close(done)
if err != nil {
Expand Down

0 comments on commit bec5b3e

Please sign in to comment.