Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

possibility to set a proxy directly in podman instead of set the system wide environment variable #4543

Closed
pirminjanka opened this issue Nov 21, 2019 · 19 comments
Assignees
Labels
do-not-close kind/feature Categorizes issue or PR as related to a new feature. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. stale-issue

Comments

@pirminjanka
Copy link

pirminjanka commented Nov 21, 2019

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind feature

possibility to set a proxy directly in podman (e.g. podman config) instead of set the system wide environment variable (e.g. in /etc/profile)

Additional information you deem important (e.g. issue happens only occasionally):

Output of podman version:

Version:            1.4.2-stable2
RemoteAPI Version:  1
Go Version:         go1.12.8
OS/Arch:            linux/amd64

RHEL8

Output of podman info --debug:

debug:
  compiler: gc
  git commit: ""
  go version: go1.12.8
  podman version: 1.4.2-stable2
host:
  BuildahVersion: 1.9.0
  Conmon:
    package: podman-1.4.2-5.module+el8.1.0+4240+893c1ab8.x86_64
    path: /usr/libexec/podman/conmon
    version: 'conmon version 2.0.1-dev, commit: unknown'
  Distribution:
    distribution: '"rhel"'
    version: "8.1"
  MemFree: 2863865856
  MemTotal: 4083748864
  OCIRuntime:
    package: runc-1.0.0-60.rc8.module+el8.1.0+4081+b29780af.x86_64
    path: /usr/bin/runc
    version: 'runc version spec: 1.0.1-dev'
  SwapFree: 8589930496
  SwapTotal: 8589930496
  arch: amd64
  cpus: 2
  kernel: 4.18.0-147.el8.x86_64
  os: linux
  rootless: false
  uptime: 11m 56.22s
registries:
  blocked: null
  insecure: null
  search:
  - registry.redhat.io
  - registry.access.redhat.com
  - quay.io
  - docker.io
store:
  ConfigFile: /etc/containers/storage.conf
  ContainerStore:
    number: 4
  GraphDriverName: overlay
  GraphOptions: null
  GraphRoot: /var/lib/containers/storage
  GraphStatus:
    Backing Filesystem: xfs
    Native Overlay Diff: "true"
    Supports d_type: "true"
    Using metacopy: "false"
  ImageStore:
    number: 3
  RunRoot: /var/run/containers/storage
  VolumePath: /var/lib/containers/storage/volumes

Package info (e.g. output of rpm -q podman or apt list podman):

podman-manpages-1.4.2-5.module+el8.1.0+4240+893c1ab8.noarch
podman-1.4.2-5.module+el8.1.0+4240+893c1ab8.x86_64

Additional environment details (AWS, VirtualBox, physical, etc.):
virtual

@openshift-ci-robot openshift-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Nov 21, 2019
@pirminjanka pirminjanka changed the title possibility to set a proxy directly in podman instead of in the system environment variable possibility to set a proxy directly in podman instead of set the system wide environment variable Nov 21, 2019
@alexcasutt
Copy link

+1

@rhatdan
Copy link
Member

rhatdan commented Nov 22, 2019

This is part of the containers/common containers.conf effort.

@rhatdan
Copy link
Member

rhatdan commented Nov 22, 2019

containers/common#20

@github-actions
Copy link

This issue had no activity for 30 days. In the absence of activity or the "do-not-close" label, the issue will be automatically closed within 7 days.

@rhatdan
Copy link
Member

rhatdan commented Feb 17, 2020

Still waiting for containers.conf to be merged.

@rhatdan
Copy link
Member

rhatdan commented Jun 9, 2020

Containers.conf is there.

@rhatdan rhatdan closed this as completed Jun 9, 2020
@abpatwa
Copy link

abpatwa commented Aug 21, 2020

How to exclude proxy while run podman, any idea?
As proxy enabling require mandate by system, pls help and suggest

@QiWang19
Copy link
Contributor

If you mean to disable passing proxy environment variables from host to
container: set --http-proxy=false

@abpatwa
Copy link

abpatwa commented Aug 21, 2020

--http-proxy=false

podman pull registryproxy01/simulator:latest --http-proxy=false

Error: unknown flag: --http-proxy

@QiWang19
Copy link
Contributor

How to exclude proxy while run podman, any idea?
As proxy enabling require mandate by system, pls help and suggest

@mheon do you know how to set this?

@mheon
Copy link
Member

mheon commented Aug 21, 2020

Podman will obey system proxy configuration from environment variables when pulling images. There is no way to disable this aside from clearing the environment variables when running Podman.

@abpatwa
Copy link

abpatwa commented Aug 24, 2020

Podman will obey system proxy configuration from environment variables when pulling images. There is no way to disable this aside from clearing the environment variables when running Podman.

Thanks for the reply. offcourse any services follow/obey system proxy variable but there must be some way to exclude while podman runs (pull/run). For eg: curl command, we can test internet with and without proxy from his flags. It will really helpful if we try to found something like that. Because proxy is mandate on system for service runnig.

@rhatdan
Copy link
Member

rhatdan commented Aug 24, 2020

Does
http_proxy="" podman pull ...

Work for you?

@abpatwa
Copy link

abpatwa commented Aug 25, 2020

Does
http_proxy="" podman pull ...

Work for you?

Dont Require this? It will work only without proxy as registry is inhouse-server. I need to exclude the proxy variable while run podman. With proxy variables its going over internet and then recvd error..

@rhatdan
Copy link
Member

rhatdan commented Aug 25, 2020

I don't understand, You can unset the environment or what ever to remove this. These environment variables effect golang, not even something Podman understands. We are not going to add an ignore the environment flag to Podman.

@abpatwa
Copy link

abpatwa commented Sep 4, 2020

I don't understand, You can unset the environment or what ever to remove this. These environment variables effect golang, not even something Podman understands. We are not going to add an ignore the environment flag to Podman.

As i said, we require internet service on that server i can disable the proxy on system as its will stop internet. So require parameter to exclude the system proxy while running podman command for pull

@rhatdan
Copy link
Member

rhatdan commented Sep 8, 2020

NoProxy=true podman ...

Should satisfy this.

@abpatwa
Copy link

abpatwa commented Sep 11, 2020

NoProxy=true

It looks like not a valid Flag

Error: unknown flag: --Noproxy
Error: unknown flag: --noproxy

@rhatdan
Copy link
Member

rhatdan commented Sep 11, 2020

If you set the environment variable no_proxy=* will tell golang/podman to not use a proxy when connecting to https.

https://godoc.org/golang.org/x/net/http/httpproxy

    // NoProxy represents the NO_PROXY or no_proxy environment
    // variable. It specifies a string that contains comma-separated values
    // specifying hosts that should be excluded from proxying. Each value is
    // represented by an IP address prefix (1.2.3.4), an IP address prefix in
    // CIDR notation (1.2.3.4/8), a domain name, or a special DNS label (*).
    // An IP address prefix and domain name can also include a literal port
    // number (1.2.3.4:80).
    // A domain name matches that name and all subdomains. A domain name with
    // a leading "." matches subdomains only. For example "foo.com" matches
    // "foo.com" and "bar.foo.com"; ".y.com" matches "x.y.com" but not "y.com".
    // A single asterisk (*) indicates that no proxying should be done.
    // A best effort is made to parse the string and errors are
    // ignored.
    NoProxy string

@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 22, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
do-not-close kind/feature Categorizes issue or PR as related to a new feature. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. stale-issue
Projects
None yet
Development

No branches or pull requests

7 participants