summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
Diffstat (limited to 'pkg')
-rw-r--r--pkg/api/handlers/compat/images_build.go26
-rw-r--r--pkg/bindings/images/build.go10
2 files changed, 26 insertions, 10 deletions
diff --git a/pkg/api/handlers/compat/images_build.go b/pkg/api/handlers/compat/images_build.go
index 0f85aa717..f0d07f492 100644
--- a/pkg/api/handlers/compat/images_build.go
+++ b/pkg/api/handlers/compat/images_build.go
@@ -72,25 +72,26 @@ func BuildImage(w http.ResponseWriter, r *http.Request) {
query := struct {
AddHosts string `schema:"extrahosts"`
AdditionalCapabilities string `schema:"addcaps"`
+ AllPlatforms bool `schema:"allplatforms"`
Annotations string `schema:"annotations"`
AppArmor string `schema:"apparmor"`
- AllPlatforms bool `schema:"allplatforms"`
BuildArgs string `schema:"buildargs"`
CacheFrom string `schema:"cachefrom"`
+ CgroupParent string `schema:"cgroupparent"` // nolint
Compression uint64 `schema:"compression"`
ConfigureNetwork string `schema:"networkmode"`
- CpuPeriod uint64 `schema:"cpuperiod"` // nolint
- CpuQuota int64 `schema:"cpuquota"` // nolint
- CpuSetCpus string `schema:"cpusetcpus"` // nolint
- CpuSetMems string `schema:"cpusetmems"` // nolint
- CpuShares uint64 `schema:"cpushares"` // nolint
- CgroupParent string `schema:"cgroupparent"` // nolint
+ CpuPeriod uint64 `schema:"cpuperiod"` // nolint
+ CpuQuota int64 `schema:"cpuquota"` // nolint
+ CpuSetCpus string `schema:"cpusetcpus"` // nolint
+ CpuSetMems string `schema:"cpusetmems"` // nolint
+ CpuShares uint64 `schema:"cpushares"` // nolint
DNSOptions string `schema:"dnsoptions"`
DNSSearch string `schema:"dnssearch"`
DNSServers string `schema:"dnsservers"`
Devices string `schema:"devices"`
Dockerfile string `schema:"dockerfile"`
DropCapabilities string `schema:"dropcaps"`
+ Envs []string `schema:"setenv"`
Excludes string `schema:"excludes"`
ForceRm bool `schema:"forcerm"`
From string `schema:"from"`
@@ -108,6 +109,8 @@ func BuildImage(w http.ResponseWriter, r *http.Request) {
Memory int64 `schema:"memory"`
NamespaceOptions string `schema:"nsoptions"`
NoCache bool `schema:"nocache"`
+ OSFeatures []string `schema:"osfeature"`
+ OSVersion string `schema:"osversion"`
OutputFormat string `schema:"outputformat"`
Platform []string `schema:"platform"`
Pull bool `schema:"pull"`
@@ -117,16 +120,16 @@ func BuildImage(w http.ResponseWriter, r *http.Request) {
Rm bool `schema:"rm"`
RusageLogFile string `schema:"rusagelogfile"`
Seccomp string `schema:"seccomp"`
+ Secrets string `schema:"secrets"`
SecurityOpt string `schema:"securityopt"`
ShmSize int `schema:"shmsize"`
Squash bool `schema:"squash"`
+ TLSVerify bool `schema:"tlsVerify"`
Tags []string `schema:"t"`
Target string `schema:"target"`
Timestamp int64 `schema:"timestamp"`
- TLSVerify bool `schema:"tlsVerify"`
Ulimits string `schema:"ulimits"`
UnsetEnvs []string `schema:"unsetenv"`
- Secrets string `schema:"secrets"`
}{
Dockerfile: "Dockerfile",
IdentityLabel: true,
@@ -544,6 +547,7 @@ func BuildImage(w http.ResponseWriter, r *http.Request) {
ContextDirectory: contextDirectory,
Devices: devices,
DropCapabilities: dropCaps,
+ Envs: query.Envs,
Err: auxout,
Excludes: excludes,
ForceRmIntermediateCtrs: query.ForceRm,
@@ -558,6 +562,8 @@ func BuildImage(w http.ResponseWriter, r *http.Request) {
MaxPullPushRetries: 3,
NamespaceOptions: nsoptions,
NoCache: query.NoCache,
+ OSFeatures: query.OSFeatures,
+ OSVersion: query.OSVersion,
Out: stdout,
Output: output,
OutputFormat: format,
@@ -569,8 +575,8 @@ func BuildImage(w http.ResponseWriter, r *http.Request) {
ReportWriter: reporter,
RusageLogFile: query.RusageLogFile,
Squash: query.Squash,
- Target: query.Target,
SystemContext: systemContext,
+ Target: query.Target,
UnsetEnvs: query.UnsetEnvs,
}
diff --git a/pkg/bindings/images/build.go b/pkg/bindings/images/build.go
index 9e0a0d798..51dcd2aa5 100644
--- a/pkg/bindings/images/build.go
+++ b/pkg/bindings/images/build.go
@@ -216,6 +216,12 @@ func Build(ctx context.Context, containerFiles []string, options entities.BuildO
if t := options.Output; len(t) > 0 {
params.Set("output", t)
}
+ if t := options.OSVersion; len(t) > 0 {
+ params.Set("osversion", t)
+ }
+ for _, t := range options.OSFeatures {
+ params.Set("osfeature", t)
+ }
var platform string
if len(options.OS) > 0 {
platform = options.OS
@@ -303,6 +309,10 @@ func Build(ctx context.Context, containerFiles []string, options entities.BuildO
params.Set("ulimits", string(ulimitsJSON))
}
+ for _, env := range options.Envs {
+ params.Add("setenv", env)
+ }
+
for _, uenv := range options.UnsetEnvs {
params.Add("unsetenv", uenv)
}