diff options
Diffstat (limited to 'pkg/bindings/images/build.go')
-rw-r--r-- | pkg/bindings/images/build.go | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/pkg/bindings/images/build.go b/pkg/bindings/images/build.go index 8ea09b881..6e16461e5 100644 --- a/pkg/bindings/images/build.go +++ b/pkg/bindings/images/build.go @@ -16,9 +16,9 @@ import ( "strings" "github.com/containers/buildah" - "github.com/containers/podman/v2/pkg/auth" - "github.com/containers/podman/v2/pkg/bindings" - "github.com/containers/podman/v2/pkg/domain/entities" + "github.com/containers/podman/v3/pkg/auth" + "github.com/containers/podman/v3/pkg/bindings" + "github.com/containers/podman/v3/pkg/domain/entities" "github.com/containers/storage/pkg/fileutils" "github.com/docker/go-units" "github.com/hashicorp/go-multierror" @@ -57,6 +57,13 @@ func Build(ctx context.Context, containerFiles []string, options entities.BuildO } params.Set("buildargs", bArgs) } + if excludes := options.Excludes; len(excludes) > 0 { + bArgs, err := jsoniter.MarshalToString(excludes) + if err != nil { + return nil, err + } + params.Set("excludes", bArgs) + } if cpuShares := options.CommonBuildOpts.CPUShares; cpuShares > 0 { params.Set("cpushares", strconv.Itoa(int(cpuShares))) } @@ -94,7 +101,9 @@ func Build(ctx context.Context, containerFiles []string, options entities.BuildO if len(options.From) > 0 { params.Set("from", options.From) } - + if options.IgnoreUnrecognizedInstructions { + params.Set("ignore", "1") + } params.Set("isolation", strconv.Itoa(int(options.Isolation))) if options.CommonBuildOpts.HTTPProxy { params.Set("httpproxy", "1") @@ -159,6 +168,13 @@ func Build(ctx context.Context, containerFiles []string, options entities.BuildO } params.Set("extrahosts", h) } + if nsoptions := options.NamespaceOptions; len(nsoptions) > 0 { + ns, err := jsoniter.MarshalToString(nsoptions) + if err != nil { + return nil, err + } + params.Set("nsoptions", ns) + } if shmSize := options.CommonBuildOpts.ShmSize; len(shmSize) > 0 { shmBytes, err := units.RAMInBytes(shmSize) if err != nil { |