0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Rancher DesktopのDocker Daemon/クライアントにプロキシを設定する

Last updated at Posted at 2025-04-02

What's?

Rancher Desktopで使うDocker Daemon/クライアントのプロキシ設定まとめということで。

環境

Rancher Desktop 1.18.2。

PS > docker version
Client:
 Version:           27.5.1-rd
 API version:       1.45 (downgraded from 1.47)
 Go version:        go1.22.11
 Git commit:        0c97515
 Built:             Thu Jan 23 18:14:31 2025
 OS/Arch:           windows/amd64
 Context:           default

Server:
 Engine:
  Version:          26.1.5
  API version:      1.45 (minimum version 1.24)
  Go version:       go1.22.5
  Git commit:       411e817ddf710ff8e08fa193da80cb78af708191
  Built:            Fri Jul 26 17:51:06 2024
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v1.7.17
  GitCommit:        3a4de459a68952ffb703bbe7f2290861a75b6b67
 runc:
  Version:          1.1.14
  GitCommit:        2c9f5602f0ba3d9da1c2596322dfc4e156844890
 docker-init:
  Version:          0.19.0
  GitCommit:

Docker Daemonのプロキシ設定

Rancher DesktopのGUI上で設定します。この設定はDockerイメージをpullする時に作用します。

Preferences → WSL → Proxyで設定。

image.png

こちらのドキュメントの内容です。

Dockerクライアントのプロキシ設定

こちらは、Dockerコンテナ内で実行するコマンドに作用します。

%USERPROFILE%\.docker\config.jsonを開きます。

手元の環境ではこんな内容でした。

%USERPROFILE%.docker\config.json
{"credsStore":"wincred","cliPluginsExtraDirs":["C:\\Program Files\\Rancher Desktop\\resources\\resources\\win32\\docker-cli-plugins"]}

以下のように変更。

%USERPROFILE%.docker\config.json
{"credsStore":"wincred","cliPluginsExtraDirs":["C:\\Program Files\\Rancher Desktop\\resources\\resources\\win32\\docker-cli-plugins"],
  "proxies": {
    "default": {
      "httpProxy": "http://your-proxy.server.com:your-proxy-port",
      "httpsProxy": "http://your-proxy.server.com:your-proxy-port"
    }
  }
}

これで、コンテナ側にhttp_proxyhttps_proxyHTTP_PROXYHTTPS_PROXY環境変数が設定された状態になります。

ドキュメントとしてはこちらの内容です

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?