HTTP proxy on Debian

Linux Debianディストリビューション(主な対象は Ubuntu)における主要なコマンドの HTTP プロキシ設定についてのメモ。

apt

設定ファイル: /etc/environment

http_proxy=<scheme>://<host>:<port>
https_proxy=<scheme>://<host>:<port>

設定ファイル: /etc/apt/conf.d/proxy.conf

Aquire::http::Proxy "<scheme>://<host>:<port>";
Aquire::https::Proxy "<scheme>://<host>:<port>";

manpages.debian.org (accessed on 2022/09/02) manpages.debian.org (accessed on 2022/09/02)

git

設定ファイル: /etc/environment

http_proxy=<scheme>://<host>:<port>
https_proxy=<scheme>://<host>:<port>

コマンドから変更する場合,

$ git config --global http.proxy <scheme>://<host>:<port>

git-scm.com (accessed on 2022/09/02)

https://gist.github.com/evantoli/f8c23a37eb3558ab8765 (accessed on 2022/09/02)

docker

ホスト用 (イメージをプルする場合など)

設定ファイル: /etc/environment

HTTP_PROXY=<scheme>://<host>:<port>
HTTPS_PROXY=<scheme>://<host>:<port>

Then, restart dockerd.

コンテナ用 (イメージをビルドする場合など)

設定ファイル: ~/.docker/config.json

{
 "proxies":
 {
   "default":
   {
     "httpProxy": "<scheme>://<host>:<port>",
     "httpsProxy": "<scheme>://<host>:<port>"
     "noProxy": "127.0.0.1"
   }
 }
}

docs.docker.com (accessed on 2022/09/02) docs.docker.com (accessed on 2022/09/02)

kubernetes(microk8s)

設定ファイル: /etc/environment

http_proxy=<scheme>://<host>:<port>
https_proxy=<scheme>://<host>:<port>
no_proxy=127.0.0.1,192.168.0.0/24,10.0.0.0/8
HTTP_PROXY=<scheme>://<host>:<port>
HTTPS_PROXY=<scheme>://<host>:<port>
NO_PROXY=127.0.0.1,192.168.0.0/24,10.0.0.0/8

microk8s.io (accessed on 2022/09/02)

curl

設定ファイル: /etc/environment

http_proxy=<scheme>://<host>:<port>
https_proxy=<scheme>://<host>:<port>

everything.curl.dev (accessed on 2022/09/02)

wget

設定ファイル: /etc/environment

http_proxy=<scheme>://<host>:<port>
https_proxy=<scheme>://<host>:<port>

www.gnu.org (accessed on 2022/09/02)