diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2020-06-18 09:48:52 -0400 |
---|---|---|
committer | Daniel J Walsh <dwalsh@redhat.com> | 2020-06-19 08:54:38 -0400 |
commit | 3556bfed09bdfb8817e4786846ec566833ae58d3 (patch) | |
tree | 846f0102d9b50c63018a1819747526508e6a10f5 /cmd/podman/images | |
parent | 5ec29f8d4e79500915ec79824d9eb21630205f3f (diff) | |
download | podman-3556bfed09bdfb8817e4786846ec566833ae58d3.tar.gz podman-3556bfed09bdfb8817e4786846ec566833ae58d3.tar.bz2 podman-3556bfed09bdfb8817e4786846ec566833ae58d3.zip |
Fix podman build handling of --http-proxy flag
Also fixed a todo for handling of cgroup manager while I was in there.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'cmd/podman/images')
-rw-r--r-- | cmd/podman/images/build.go | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/cmd/podman/images/build.go b/cmd/podman/images/build.go index 2efc795cd..23bfcab79 100644 --- a/cmd/podman/images/build.go +++ b/cmd/podman/images/build.go @@ -9,6 +9,7 @@ import ( "github.com/containers/buildah/imagebuildah" buildahCLI "github.com/containers/buildah/pkg/cli" "github.com/containers/buildah/pkg/parse" + "github.com/containers/common/pkg/config" "github.com/containers/libpod/cmd/podman/registry" "github.com/containers/libpod/cmd/podman/utils" "github.com/containers/libpod/pkg/domain/entities" @@ -396,16 +397,10 @@ func buildFlagsWrapperToOptions(c *cobra.Command, contextDir string, flags *buil runtimeFlags = append(runtimeFlags, "--"+arg) } - // FIXME: the code below needs to be enabled (and adjusted) once the - // global/root flags are supported. - - // conf, err := runtime.GetConfig() - // if err != nil { - // return err - // } - // if conf != nil && conf.Engine.CgroupManager == config.SystemdCgroupsManager { - // runtimeFlags = append(runtimeFlags, "--systemd-cgroup") - // } + containerConfig := registry.PodmanConfig() + if containerConfig.Engine.CgroupManager == config.SystemdCgroupsManager { + runtimeFlags = append(runtimeFlags, "--systemd-cgroup") + } opts := imagebuildah.BuildOptions{ AddCapabilities: flags.CapAdd, @@ -418,12 +413,13 @@ func buildFlagsWrapperToOptions(c *cobra.Command, contextDir string, flags *buil CNIPluginPath: flags.CNIPlugInPath, CommonBuildOpts: &buildah.CommonBuildOptions{ AddHost: flags.AddHost, - CgroupParent: flags.CgroupParent, CPUPeriod: flags.CPUPeriod, CPUQuota: flags.CPUQuota, - CPUShares: flags.CPUShares, CPUSetCPUs: flags.CPUSetCPUs, CPUSetMems: flags.CPUSetMems, + CPUShares: flags.CPUShares, + CgroupParent: flags.CgroupParent, + HTTPProxy: flags.HTTPProxy, Memory: memoryLimit, MemorySwap: memorySwap, ShmSize: flags.ShmSize, |