|
| 1 | +package oci |
| 2 | + |
| 3 | +import ( |
| 4 | + "github.com/containerd/containerd/oci" |
| 5 | + "github.com/docker/docker/pkg/idtools" |
| 6 | + "github.com/moby/buildkit/solver/pb" |
| 7 | + specs "github.com/opencontainers/runtime-spec/specs-go" |
| 8 | + "github.com/pkg/errors" |
| 9 | +) |
| 10 | + |
| 11 | +func generateMountOpts(resolvConf, hostsFile string) ([]oci.SpecOpts, error) { |
| 12 | + return nil, nil |
| 13 | +} |
| 14 | + |
| 15 | +// generateSecurityOpts may affect mounts, so must be called after generateMountOpts |
| 16 | +func generateSecurityOpts(mode pb.SecurityMode, apparmorProfile string, selinuxB bool) ([]oci.SpecOpts, error) { |
| 17 | + if mode == pb.SecurityMode_INSECURE { |
| 18 | + return nil, errors.New("no support for running in insecure mode on FreeBSD") |
| 19 | + } |
| 20 | + return nil, nil |
| 21 | +} |
| 22 | + |
| 23 | +// generateProcessModeOpts may affect mounts, so must be called after generateMountOpts |
| 24 | +func generateProcessModeOpts(mode ProcessMode) ([]oci.SpecOpts, error) { |
| 25 | + if mode == NoProcessSandbox { |
| 26 | + return nil, errors.New("no support for NoProcessSandbox on FreeBSD") |
| 27 | + } |
| 28 | + return nil, nil |
| 29 | +} |
| 30 | + |
| 31 | +func generateIDmapOpts(idmap *idtools.IdentityMapping) ([]oci.SpecOpts, error) { |
| 32 | + if idmap == nil { |
| 33 | + return nil, nil |
| 34 | + } |
| 35 | + return nil, errors.New("no support for IdentityMapping on FreeBSD") |
| 36 | +} |
| 37 | + |
| 38 | +func generateRlimitOpts(ulimits []*pb.Ulimit) ([]oci.SpecOpts, error) { |
| 39 | + if len(ulimits) == 0 { |
| 40 | + return nil, nil |
| 41 | + } |
| 42 | + return nil, errors.New("no support for POSIXRlimit on FreeBSD") |
| 43 | +} |
| 44 | + |
| 45 | +// tracing is not implemented on FreeBSD |
| 46 | +func getTracingSocketMount(socket string) *specs.Mount { |
| 47 | + return nil |
| 48 | +} |
| 49 | + |
| 50 | +// tracing is not implemented on FreeBSD |
| 51 | +func getTracingSocket() string { |
| 52 | + return "" |
| 53 | +} |
| 54 | + |
| 55 | +func cgroupNamespaceSupported() bool { |
| 56 | + return false |
| 57 | +} |
0 commit comments