@@ -632,6 +632,37 @@ func WithAllPortsPublished() Opt {
632632 }
633633}
634634
635+ // WithCPUSet configures the [set of CPUs] on which processes of the container
636+ // are allowed to execute. The list of CPUs is a comma-separated list of CPU
637+ // numbers and ranges of numbers, where the numbers are decimal numbers. For
638+ // instance, “1,3,5”, "0-42,666", et cetera.
639+ //
640+ // To avoid stuttering this option is simply named “WithCPUSet” instead of
641+ // “WithCpusetCPUs”, or similar awkward letter salads.
642+ //
643+ // [set of CPUs]: https://man7.org/linux/man-pages/man7/cpuset.7.html
644+ func WithCPUSet (cpulist string ) Opt {
645+ return func (o * Options ) error {
646+ o .Host .CpusetCpus = cpulist
647+ return nil
648+ }
649+ }
650+
651+ // WithMems configures the [set of memory nodes] on which processes of the
652+ // container are allowed to allocate memory. The list of memory nodes is a
653+ // comma-separated list of memory node numbers and ranges of numbers, where the
654+ // numbers are decimal numbers. For instance, “1,3,5”, "0-42,666", et cetera.
655+ //
656+ // [set of memory nodes]: https://man7.org/linux/man-pages/man7/cpuset.7.html
657+ func WithMems (memlist string ) Opt {
658+ return func (o * Options ) error {
659+ o .Host .CpusetMems = memlist
660+ return nil
661+ }
662+ }
663+
664+ // WithCustomInit instructs Docker to run an init inside the container that
665+ // forwards signals and reaps processes.
635666func WithCustomInit () Opt {
636667 return func (o * Options ) error {
637668 customInit := true
0 commit comments