build: add shm-size support

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2021-10-19 21:05:52 +02:00
parent 22500c9929
commit 8e5595b7c7
3 changed files with 16 additions and 2 deletions

View File

@ -57,6 +57,7 @@ type Options struct {
ImageIDFile string
ExtraHosts []string
NetworkMode string
ShmSize opts.MemBytes
Ulimits *opts.UlimitOpt
NoCache bool
@ -556,6 +557,11 @@ func toSolveOpt(ctx context.Context, d driver.Driver, multiDriver bool, opt Opti
}
so.FrontendAttrs["add-hosts"] = extraHosts
// setup shm size
if opt.ShmSize.Value() > 0 {
so.FrontendAttrs["shm-size"] = strconv.FormatInt(opt.ShmSize.Value(), 10)
}
// setup ulimits
ulimits, err := toBuildkitUlimits(opt.Ulimits)
if err != nil {