DNS issues in user-defined docker networks

Aperta
#575 10 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
50/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
docker, go
Ambito
networking

Direzione di ricerca

Inizia riproducendo i comandi forniti per la rete Docker e il container urunc, quindi ispeziona /etc/resolv.conf ed esegui nslookup github.com all’interno del container. Il lavoro è completato quando la risoluzione DNS funziona per i container basati su urunc nelle reti Docker definite dall’utente, senza gli errori di connessione rifiutata e timeout descritti.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Go
Stelle
308
Fork
222
Merge medio
2g 12h
PR unite (30g)
42

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di urunc-dev/urunc

Tutte le issue di urunc-dev/urunc

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.