support podman-remote to connect tcpURL with proxy

1. proxy value from env `CONTAINER_PROXY`
2. proxy socks5 && socks5h is supported
3. the proxy dial timeout is 3s

Signed-off-by: shuai.yang <shuai.yang@mihoyo.com>
This commit is contained in:
shuai.yang
2022-11-17 16:16:08 +08:00
parent 54b1fd35bd
commit 0d270ae380
11 changed files with 959 additions and 8 deletions

View File

@ -55,17 +55,19 @@ Log messages above specified level: debug, info, warn, error (default), fatal or
URL to access Podman service (default from `containers.conf`, rootless "unix://run/user/$UID/podman/podman.sock" or as root "unix://run/podman/podman.sock).
- `CONTAINER_HOST` is of the format `<schema>://[<user[:<password>]@]<host>[:<port>][<path>]`
- `CONTAINER_PROXY` is of the format `<socks5|socks5h>://[<user[:<password>]@]<host>[:<port>]`
Details:
- `schema` is one of:
* `ssh` (default): a local unix(7) socket on the named `host` and `port`, reachable via SSH
* `tcp`: an unencrypted, unauthenticated TCP connection to the named `host` and `port`
* `tcp`: an unencrypted, unauthenticated TCP connection to the named `host` and `port`, can work with proxy if `CONTAINER_PROXY` set
* `unix`: a local unix(7) socket at the specified `path`, or the default for the user
- `user` will default to either `root` or the current running user (`ssh` only)
- `password` has no default (`ssh` only)
- `host` must be provided and is either the IP or name of the machine hosting the Podman service (`ssh` and `tcp`)
- `port` defaults to 22 (`ssh` and `tcp`)
- `path` defaults to either `/run/podman/podman.sock`, or `/run/user/$UID/podman/podman.sock` if running rootless (`unix`), or must be explicitly specified (`ssh`)
- `CONTAINER_PROXY`: use proxy (`socks5` or `socks5h`) to access Podman service (`tcp` only)
URL value resolution precedence:
- command line value