Endevouring, um mehr über Docker zu erfahren. Willst du meine Arbeit an einer ec2-Instanz machen? Dachte dieses Tutorial war ein guter Anfang: Docker Basics. Wenn ich versuche, das Docker-Image aus der Docker-Datei zu erstellen, erhalte ich Fehler beim Ausführen von apt-get update -y
.Docker Ubuntu Build schlägt auf ec2 fehl
Zunächst dachte eine nicht unterstützte Ubuntu-Version (12.04) war ein Problem so aktualisiert, dass Verweis auf die neuesten (17.04) und noch Fehler in Bezug auf apt-update (unten).
Update: Ich habe die Schritte auf einem nicht-ec2-Maschine ausgeführt und bekam eine andere Ausgabe bei der apt-update-Stufe, also etwas in der ec2-Konfiguration, denke ich, die Netzwerkkonnektivität zu stören.
Jede Hilfe wird geschätzt. Konsolenausgabe unter:
ec2 docker build --no-cache -t moikaturns/amazon-ecs-sample .
Sending build context to Docker daemon 363 kB
Step 1/12 : FROM ubuntu:17.04
---> bde41be8de8c
Step 2/12 : RUN apt-get update -y
---> Running in d8132cda2e2a
Err:1 http://security.ubuntu.com/ubuntu zesty-security InRelease
Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1560:8001::14). - connect (101: Network is unreachable) [IP: 2001:67c:1560:8001::14 80]
Err:2 http://archive.ubuntu.com/ubuntu zesty InRelease
Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::21). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8001::21 80]
Err:3 http://archive.ubuntu.com/ubuntu zesty-updates InRelease
Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::21). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8001::21 80]
Err:4 http://archive.ubuntu.com/ubuntu zesty-backports InRelease
Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::21). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8001::21 80]
Reading package lists...
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/zesty/InRelease Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::21). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8001::21 80]
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/zesty-updates/InRelease Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::21). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8001::21 80]
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/zesty-backports/InRelease Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1360:8001::21). - connect (101: Network is unreachable) [IP: 2001:67c:1360:8001::21 80]
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/zesty-security/InRelease Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1560:8001::14). - connect (101: Network is unreachable) [IP: 2001:67c:1560:8001::14 80]
W: Some index files failed to download. They have been ignored, or old ones used instead.
---> 6aa041d69aec
Removing intermediate container d8132cda2e2a
Step 3/12 : RUN apt-get install -y git curl apache2 php5 libapache2-mod-php5 php5-mcrypt php5-mysql
---> Running in 1b807c9fd593
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package git
E: Unable to locate package curl
E: Unable to locate package apache2
E: Unable to locate package php5
E: Unable to locate package libapache2-mod-php5
E: Unable to locate package php5-mcrypt
E: Unable to locate package php5-mysql
The command '/bin/sh -c apt-get install -y git curl apache2 php5 libapache2-mod-php5 php5-mcrypt php5-mysql' returned a non-zero code: 100
Inhalt von /etc/resolve.conf erhalten, wenn das Dockerbuild Skript ausgeführt wird. Es wird vom System generiert und vom Host-Rechner bezogen (zu dem ich den Google-DNS hinzugefügt habe). Die Ausgabe aus dem Dockerfile Skript bestätigt die Inhalte im Rahmen des Skripts läuft:
Step 2/13 : RUN cat /etc/resolv.conf
---> Running in 68b494d1fcdb
; generated by /sbin/dhclient-script
search eu-west-1.compute.internal
nameserver 172.31.0.2
nameserver 8.8.8.8
Ausführen dieses auf der EC2-Instanz funktioniert, aber ich kann es im Innern des Dockerfile Skript nicht ausgeführt werden (weil die ubuntu nicht mit curl kommt installiert und ich kann nicht laufen apt-get irgendetwas installieren aufgrund der Netzausgabe):
ec2 curl ipinfo.io
{
"ip": "52.17.159.7",
"hostname": "ec2-52-17-159-7.eu-west-1.compute.amazonaws.com",
"city": "Dublin",
"region": "Leinster",
"country": "IE",
"loc": "53.3389,-6.2595",
"org": "AS16509 Amazon.com, Inc."
}
Ich vermute, dass Ihre Sicherheitsgruppe nicht konfiguriert ist, damit diese ec2-Instanz mit dem Internet kommunizieren kann. Es kann auch ein Problem mit IPv6 sein. – BMitch
Was ist die Ausgabe von 'cat/etc/resolv.conf' auf Ihrem ec2-Rechner? Funktioniert 'curl ipinfo.io' auch auf Ihrer ec2 Maschine? –