summaryrefslogtreecommitdiff
path: root/vendor/github.com/moby/buildkit/executor/runcexecutor/executor.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/moby/buildkit/executor/runcexecutor/executor.go')
-rw-r--r--vendor/github.com/moby/buildkit/executor/runcexecutor/executor.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/vendor/github.com/moby/buildkit/executor/runcexecutor/executor.go b/vendor/github.com/moby/buildkit/executor/runcexecutor/executor.go
index 62c2891a57..14790229e0 100644
--- a/vendor/github.com/moby/buildkit/executor/runcexecutor/executor.go
+++ b/vendor/github.com/moby/buildkit/executor/runcexecutor/executor.go
@@ -42,9 +42,10 @@ type Opt struct {
ProcessMode oci.ProcessMode
IdentityMapping *idtools.IdentityMapping
// runc run --no-pivot (unrecommended)
- NoPivot bool
- DNS *oci.DNSConfig
- OOMScoreAdj *int
+ NoPivot bool
+ DNS *oci.DNSConfig
+ OOMScoreAdj *int
+ ApparmorProfile string
}
var defaultCommandCandidates = []string{"buildkit-runc", "runc"}
@@ -62,6 +63,7 @@ type runcExecutor struct {
oomScoreAdj *int
running map[string]chan error
mu sync.Mutex
+ apparmorProfile string
}
func New(opt Opt, networkProviders map[pb.NetMode]network.Provider) (executor.Executor, error) {
@@ -124,6 +126,7 @@ func New(opt Opt, networkProviders map[pb.NetMode]network.Provider) (executor.Ex
dns: opt.DNS,
oomScoreAdj: opt.OOMScoreAdj,
running: make(map[string]chan error),
+ apparmorProfile: opt.ApparmorProfile,
}
return w, nil
}
@@ -253,7 +256,7 @@ func (w *runcExecutor) Run(ctx context.Context, id string, root executor.Mount,
}
opts = append(opts, containerdoci.WithCgroup(cgroupsPath))
}
- spec, cleanup, err := oci.GenerateSpec(ctx, meta, mounts, id, resolvConf, hostsFile, namespace, w.processMode, w.idmap, opts...)
+ spec, cleanup, err := oci.GenerateSpec(ctx, meta, mounts, id, resolvConf, hostsFile, namespace, w.processMode, w.idmap, w.apparmorProfile, opts...)
if err != nil {
return err
}