In my understanding, the hostname of a container within a compose configuration is the name of the service in the compose file.
` db:
image: mariadb
ports:
"3306:3306"
volumes:
dbdata:/var/lib/mysql`
Following the README to install Magento2, I found that the hostname suggest dockermagento2_db_1 did not work for me, but db did.
For example, suppose your app is in a directory called myapp, and your docker-compose.yml looks like this:
`
version: "3"
services:
web:
build: .
ports:
"8000:8000"
db:
image: postgres
ports:
"8001:5432"
`
When you run docker-compose up, the following happens:
A network called myapp_default is created.
A container is created using web’s configuration. It joins the network myapp_default under the name web.
A container is created using db’s configuration. It joins the network myapp_default under the name db.
In my understanding, the hostname of a container within a compose configuration is the name of the service in the compose file. ` db: image: mariadb ports:
Following the README to install Magento2, I found that the hostname suggest
dockermagento2_db_1
did not work for me, butdb
did.From the Docker doc:
` version: "3" services: web: build: . ports:
I am going to submit a PR to this effect.