DNS issues in user-defined docker networks

オープン
#575 コメント 10 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
50/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
docker, go
領域
networking

調査の方向性

まず、提供されている Docker ネットワークおよび urunc コンテナのコマンドを再現し、次に /etc/resolv.conf を確認して、コンテナ内で nslookup github.com を実行します。ユーザー定義 Docker ネットワーク上の urunc ベースのコンテナで、説明されている connection-refused エラーや timeout エラーが発生せず DNS 解決が機能すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

K8s/Tools Network

The DNS resolution for urunc-based containers which start in a user-defined network of docker does not work. To reproduce the issue:

  1. Create a new network in docker.
$ sudo docker network create -d bridge my-bridge-network
74bc6ad05c22bdec6267fe95d27b3c3ac13be3bda89c73463890068893bbbaff
  1. Start a urunc container in this network:
$ sudo docker run --rm --network my-bridge-network -it --runtime io.containerd.urunc.v2 harbor.nbfc.io/nubificus/urunc/busybox-qemu-linux-raw:latest
  1. From inside the container try to resolve any domain:
# nslookup github.com
nslookup: write to '127.0.0.11': Connection refused
;; connection timed out; no servers could be reached

As shown from nslookup, the DNS request goes to 127.0.0.11. Also the /etc/resolv.conf of the container:

# cat /etc/resolv.conf 
# Generated by Docker Engine.
# This file can be edited; Docker Engine will not make further changes once it
# has been modified.

nameserver 127.0.0.11
...

This happens because docker sets up an internal DNS server which listens at localhost for each container inside the network namespace (See https://docs.docker.com/engine/network/#dns-services). Therefore, when docker sets the localhost as a DNS server in /etc/resolv.conf, a urunc based container does not communicate with the localhost of the network namespace in the host, but with the localhost inside the sandbox and hence the request fails.

主要言語
Go
スター
308
フォーク
222
平均マージ
2日 8時間
マージ済み PR(30日)
43

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

urunc-dev/urunc のほかの issue

urunc-dev/urunc の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。