RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1682970 - [RFE] Default location of setting up HTTP_Proxy for podman
Summary: [RFE] Default location of setting up HTTP_Proxy for podman
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: podman
Version: 8.3
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: rc
: 8.3
Assignee: Jindrich Novy
QA Contact: atomic-bugs@redhat.com
URL:
Whiteboard:
Depends On:
Blocks: 1186913 1804543
TreeView+ depends on / blocked
 
Reported: 2019-02-26 01:08 UTC by Suhaas Bhat
Modified: 2024-03-25 15:14 UTC (History)
17 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-11-04 03:05:10 UTC
Type: Enhancement
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 3939131 0 Configure None Setting up HTTP Proxy variables for podman 2019-04-14 08:17:38 UTC

Description Suhaas Bhat 2019-02-26 01:08:46 UTC
Description of problem:
There is no default file location in which we can add the HTTP Proxy variables.
Currently we access them only through systemd environment variables.

Version-Release number of selected component (if applicable):
RHEL 8
podman-1.0.0-1.git82e8011.module+el8+2696+e59f0461.x86_64


Actual results:


Expected results:

Default location to add proxy variables as in case of docker

Comment 1 Daniel Walsh 2019-02-26 13:56:24 UTC
Where do you think they should be added?  These needed to be added to the environment of the user running podman.

/etc/profiles.d 

Might be the location?

Do you think we should document this in the man pages?

Comment 2 Daniel Walsh 2019-03-01 10:18:08 UTC
Suhaas, Ideas on /etc/profiles.d?

Comment 5 Daniel Walsh 2019-08-14 13:07:54 UTC
We have talked about this internally and have discussed creating a containers.conf that could be shared between all container engines. 

The other choice would be to extend registries.conf to include proxy settings.

Comment 6 Valentin Rothberg 2019-08-14 14:50:44 UTC
For pulling, we should use `registries.conf`. For injecting it into containers, we should use another config.

Comment 8 Daniel Walsh 2019-08-15 11:32:46 UTC
Containers.conf seems the logical spot for this.  In crio.conf we currently have

Comment 11 Daniel Walsh 2019-11-08 18:48:18 UTC
It is still being worked on under 
https://github.com/containers/common/tree/master/pkg/config

And 

https://github.com/containers/buildah/pull/1858

I don't think it will show up until RHEL8.2.1 release.  We are holding off for 8.2 because it is a big change, and 8.2 is going to be a stable release. 
Which means we would need to back port for 2 years.  Once we have it in, we should iterate quickly. 

We are hoping to finalize on the format for the config file next week.

Comment 15 Daniel Walsh 2020-02-11 13:59:25 UTC
So you want these environment variables set not for the containers but for Podman itself to use.

I think we should still use this through containers_conf.  Something like:

# Set Proxy environment variables to be used by container runtimes when working with the registries.
# http_proxy_env=[ "HTTP_PROXY=proxy.company.com", "https_proxy=proxy.company.com" ]

Comment 16 Derrick Ornelas 2020-02-12 17:03:45 UTC
It may be confusing that "http_proxy" doesn't actually take a proxy location.  Maybe something like "pass_proxy_env = true" or "pass_http_proxy_env = true" instead would be more user-friendly?   Then they can fill out this http_proxy_env list, if needed.  


Also, will a non-root user get their own $HOME/.config/containers/containers.conf by default, or will it just be an optional file that a user can create for overrides?

Comment 17 Daniel Walsh 2020-02-13 10:56:20 UTC
All containers.conf files are optional and really we are just merging them together.  So you only need to replace the one or two options you want.

I thought customers wanted to specify environment variables that apply to the container engine.

Something like

#
# Additional environment variables to apply to the container engine.  For example "http_proxy=internal.proxy.company.com"
#
# container_engine_env []

Then when the container engine starts up it modifies it's environment to include these environment variables.  The question
then would be should these environment variables leak through to the containers.  I would guess no, but this would mean
that the callers would need to set them twice, it they wanted them in both places.

Comment 22 Daniel Walsh 2020-06-03 14:09:55 UTC
This is in podman2.0

Comment 23 Derrick Ornelas 2020-06-05 01:35:02 UTC
Dan, could you confirm where this change was made?  From https://github.com/containers/libpod/tree/v2.0.0-rc4/vendor/github.com/containers/common/pkg/config I still don't see where we can define the proxy variables themselves.

Comment 24 Daniel Walsh 2020-06-05 09:58:27 UTC
You would set them in the Env block.

# Environment variable list for the conmon process; used for passing necessary
# environment variables to conmon or the runtime.
#
# env = [
#    "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
# ]

man containers.conf
...
       env=["PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"]
         Environment variable list for the container process, used for passing environment variables to the container.

Comment 25 Derrick Ornelas 2020-06-05 14:44:00 UTC
Got it, thanks!

Comment 26 Tom Sweeney 2020-06-08 21:44:42 UTC
Fixed in https://github.com/containers/buildah/pull/2011 and possibly other PR's.  Assigning to Jindrich in case there's any packaging needs.

Comment 27 Jindrich Novy 2020-06-09 07:40:12 UTC
Tom, I'm confused, the bug is reported against podman but PR you refer to is against buildah?

Dan, is the support for this already in podman-2.0.0-rc4 so I can switch this to MODIFIED?

Comment 28 Daniel Walsh 2020-06-09 14:54:29 UTC
Yes this is supported in podman 2.0

Comment 30 Tom Sweeney 2020-06-09 15:31:30 UTC
Jindrich,
My bad, that was the Buildah one, I'm not sure exactly which one for Podman but certainly with this one: https://github.com/containers/libpod/pull/6428 and probably with https://github.com/containers/libpod/pull/6333.  Regardless, in v2.0 of Podman for sure.

Comment 37 Joy Pu 2020-07-27 12:26:52 UTC
Test with podman-2.0.0-0.9.rc7.module+el8.3.0+7084+c16098dd.x86_64, and seems it works as expect. So set this to verified. Details:

in /usr/share/containers/containers.conf:

...
env = [
   "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
   "http_proxy=fake.check.value",
   "https_proxy=fake.check.value",
]
...

# podman run -it busybox 
/ # echo $http_proxy
fake.check.value
/ # echo $https_proxy
fake.check.value
/ # exit

Comment 40 errata-xmlrpc 2020-11-04 03:05:10 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: container-tools:rhel8 security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2020:4694


Note You need to log in before you can comment on or make changes to this bug.