2017-10-04 1 views
1

saluer,django échoué dans dockerfile installent runnung sur ubuntu

J'ai suivi l'exemple de composition de docker QuickStart à https://docs.docker.com/compose/django/, en utilisant mon environnement de docker dans CentOS VM et Ubuntu VM. L'exemple fonctionne dans CentOS, mais pas dans Ubuntu. L'échec se produit dans

RUN pip install -r requirements.txt 

L'erreur est aussi

Step 6/7 : RUN pip install -r requirements.txt 
---> Running in 7ed9830cea5f 
Collecting Django (from -r requirements.txt (line 1)) 
    Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7fe12ff70470>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /simple/django/ 
    Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7fe12ff70438>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /simple/django/ 
    Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7fe12ff706a0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /simple/django/ 
    Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7fe12f4fe5f8>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /simple/django/ 
    Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7fe12f4fea58>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)': /simple/django/ 
    Could not find a version that satisfies the requirement Django (from -r requirements.txt (line 1)) (from versions:) 
No matching distribution found for Django (from -r requirements.txt (line 1)) 

Pourriez-vous me aider ce dépannage, et comprendre pourquoi cela se produit dans Ubuntu, mais pas dans CentOS?

Merci ...

Répondre

0

Lancer la recherche pip et assurez-vous ce que vous cherchez est là. On dirait que des erreurs il ne peut pas réellement le trouver.

Les documents Docker ont tendance à être obsolètes sur le site principal.

1

Il s'est avéré que mon /etc/resolv.conf pointait vers un mauvais serveur de noms. J'ai encore besoin d'étudier pourquoi cela arrive. Si vous mettez manuellement le bon DNS, les conteneurs docker ont un réseau.