LoginSignup
0
0

More than 1 year has passed since last update.

Proxy 環境下で WSL2 から Docker 起動する際に必要だった設定

Posted at

背景

ROS2 を学習する必要が生じた
で、tutorials を実行する為の Docker 環境を WSL2 で用意することにした際の備忘録

NVIDIA に関する記事を先にやってて、以下もあった・・

Proxy の設定

/etc/default/docker

の以下の部分をコメント外して環境に合わせて修正するだけで良かった。

#export http_proxy="http://127.0.0.1:3128/"

公式にある以下の設定だけでもいけたのかもしれないが、未確認

.docker/config.json

Docker run した際にエラー

docker build/run しようとすると以下のようなエラーが発生

ban されてるとか言われる。ブラウザから繋げてもダメで、ナニコレ?って状態

docker: error pulling image configuration: download failed after attempts=1: error parsing HTTP 403 response body: invalid character '<' looking for beginning of value: "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n<html>\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n<meta name=\"referrer\" content=\"no-referrer\">\n    <title>The URL you requested has been blocked</title>\n    <style type=\"text/css\">\n        html, body { margin: 0; padding: 0; font-family: Verdana, Arial, sans-serif; font-size: 10pt; }\n        h1, h2 { height: 82px; text-indent: -999em; margin: 0; padding: 0; margin: 0; }\n        div { margin: 0; padding: 0; }\n        div.header { background: url(http://production.cloudflare.docker.com\r\n:8008/XX/YY/ZZ/CI/MGPGHGPGPFGHCDPFGGOGFGEH) 0 0 repeat-x; height: 82px; }\n        div.header h1 { background: url(http://production.cloudflare.docker.com\r\n:8008/XX/YY/ZZ/CI/MGPGHGPGPFGHCDPFGGHGFHBGCHEGPFHHGG) 0 0 no-repeat; }\n        div.header h2 { background: url(http://production.cloudflare.docker.com\r\n:8008/XX/YY/ZZ/CI/MGPGHGPGPFGHCDPFGGOGFGEH) 0 -82px no-repeat; width: 160px; float: right; }\n        div.sidebar { width: 195px; height: 200px; float: left; }\n        div.main { padding: 5px; margin-left: 195px; }\n        div.buttons { margin-top: 30px; text-align: right; }\n        h3 { margin: 36px 0; font-size: 16pt; }\n        .blocked      h3 { color: #c00; }\n        .authenticate h3 { color: #36c; }\n        h2.fgd_icon { background: url(http://production.cloudflare.docker.com\r\n:8008/XX/YY/ZZ/CI/MGPGHGPGPFGHCDPFGGOGFGEH) 0 -166px repeat-x; width: 90px; height: 92px; margin: 48px auto; }\n        .blocked      h2.fgd_icon { background-position: 0 -166px; }\n        .authenticate h2.fgd_icon { background-position: -89px -166px; }\n        form { width: 300px; margin: 30px 0; }\n        label { display: block; width: 300px; margin: 5px 0; line-height: 25px; }\n        label input { width: 200px; border: 1px solid #7f9db9; height: 20px; float: right; }\n    </style>\n</head>\n<body class=\"block\">\n    <div class=\"header\">\n        <h2>Powered By Fortinet</h2>\n        <h1>FortiGuard Web Filtering</h1>\n    </div>\n    <div class=\"sidebar\">\n        <h2 class=\"fgd_icon\">block</h2>\n    </div>\n    <div class=\"main\">\n<h3>Web Page Blocked!</h3>\n<div class=\"notice\">\n    <p>The page you have requested has been blocked, because the URL is\nbanned.</p>\n    <p>\n        URL: https://production.cloudflare.docker.com\r\n/<br />\n        <br/>Client IP: 10.240.45.37\n        <br/>Server IP: 104.18.121.25\n        <br/>User name: \n        <br/>Group name: \n    </p>\n    <p>\n        \n    </p>\n</div>\n    </div>\n</body>\n</html>\r\n".
See 'docker run --help'.

ネットで検索してみると、

DNS っぽかったので以下を試してみたけど変わらず

  • adapter
  • /etc/resolve.conf

で、proxy 周りも一緒にやってみたけど駄目

  • .docker/config.json
  • /etc/systemd/system/docker.service.d/https-proxy.conf

ただ、同僚に確認してみたら、特になんも設定せずに繋がったとか聞いて・・

/etc/default/docker

の設定を見直したところ解決

vi で編集時に修正ミスしてただけだった・・

docker に host をマウントする際のミス

-v と image name の順序が逆(image name の後に -v を指定してしまっていた)な為、mount 出来なかった・・

あとがき

docker for windows のライセンス買ってもいいって話もあったけど
有償版使うと、環境変わったときにまた困りそうだったので、無償版で頑張る所存

ってか、Docker なんかより JETSON とか C++ Cmake とかのほうが・・障害としてでかそうなんだよな・・

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