Ich habe eine Umgebung mit ein paar Containern. Einige von ihnen sind verknüpft. Wenn ich die Umgebung mit "docker-compose up -d" ausführe, erzeugt es Einträge in etc/hosts für verknüpfte Container. Wenn ich es mit "eb local run" starte, werden keine Einträge erstellt. Warum das?Elastic Beanstalk Multicontainer Docker Umgebung: keine Einträge in etc/Hosts für linierte Container
Mein Dockerrun.aws.json
{
"AWSEBDockerrunVersion": 2,
"containerDefinitions": [
{
"name": "api",
"image": "php7",
"essential": true,
"memory": 128,
"portMappings": [
{
"hostPort": 8080,
"containerPort": 80
}
],
"mountPoints": [
{
"sourceVolume": "api",
"containerPath": "/var/www/html/"
}
]
},
{
"name": "nodeapi",
"image": "nodejs",
"essential": true,
"memory": 256,
"portMappings": [
{
"hostPort": 5000,
"containerPort": 5000
}
],
"mountPoints": [
{
"sourceVolume": "nodeapi",
"containerPath": "/var/www/app/"
}
],
"Logging": "/var/eb_log"
},
{
"name": "proxy",
"image": "nginx",
"essential": true,
"memory": 128,
"links": [
"api",
"nodeapi"
],
"portMappings": [
{
"hostPort": 8443,
"containerPort": 80
}
]
}
]
}
Dies erzeugt Docker-compose.yml:
api:
image: php7
ports:
- 8080:80
nodeapi:
image: nodejs
ports:
- 5000:5000
proxy:
image: nginx
links:
- api:api
- nodeapi:nodeapi
ports:
- 8443:80
Vielen Dank für Ihre Antwort. Meine Docker-Version ist 1.9.1. Willst du sagen, dass Links, wenn ich auf die neueste Version upgrade, nicht mehr funktionieren, wenn docker-compose verwendet wird? – terreb
Es ist immer noch eine Option, nur nicht weiter zu empfehlen. Die DNS-Erkennung wurde in 1.10 hinzugefügt und im Februar veröffentlicht. – BMitch
Ok, danke. Aber wissen Sie, warum die EB Multicontainer Docker-Umgebung keine Aliase für diese Links zu etc/hosts hinzufügt, während docker-compose das tut? – terreb