(dockerCli command.Cli, options buildOptions)
| 408 | } |
| 409 | |
| 410 | func imageBuildOptions(dockerCli command.Cli, options buildOptions) client.ImageBuildOptions { |
| 411 | configFile := dockerCli.ConfigFile() |
| 412 | |
| 413 | var buildPlatforms []ocispec.Platform |
| 414 | if options.platform != "" { |
| 415 | // Already validated. |
| 416 | buildPlatforms = append(buildPlatforms, platforms.MustParse(options.platform)) |
| 417 | } |
| 418 | return client.ImageBuildOptions{ |
| 419 | Version: buildtypes.BuilderV1, |
| 420 | Memory: options.memory.Value(), |
| 421 | MemorySwap: options.memorySwap.Value(), |
| 422 | Tags: options.tags.GetSlice(), |
| 423 | SuppressOutput: options.quiet, |
| 424 | NoCache: options.noCache, |
| 425 | Remove: options.rm, |
| 426 | ForceRemove: options.forceRm, |
| 427 | PullParent: options.pull, |
| 428 | Isolation: container.Isolation(options.isolation), |
| 429 | CPUSetCPUs: options.cpuSetCpus, |
| 430 | CPUSetMems: options.cpuSetMems, |
| 431 | CPUShares: options.cpuShares, |
| 432 | CPUQuota: options.cpuQuota, |
| 433 | CPUPeriod: options.cpuPeriod, |
| 434 | CgroupParent: options.cgroupParent, |
| 435 | ShmSize: options.shmSize.Value(), |
| 436 | Ulimits: options.ulimits.GetList(), |
| 437 | BuildArgs: configFile.ParseProxyConfig(dockerCli.Client().DaemonHost(), opts.ConvertKVStringsToMapWithNil(options.buildArgs.GetSlice())), |
| 438 | Labels: opts.ConvertKVStringsToMap(options.labels.GetSlice()), |
| 439 | CacheFrom: options.cacheFrom, |
| 440 | SecurityOpt: options.securityOpt, |
| 441 | NetworkMode: options.networkMode, |
| 442 | Squash: options.squash, |
| 443 | ExtraHosts: options.extraHosts.GetSlice(), |
| 444 | Target: options.target, |
| 445 | Platforms: buildPlatforms, |
| 446 | } |
| 447 | } |
no test coverage detected
searching dependent graphs…