Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DB Host Connection Requires host.docker.internal #22

Open
carlos-reynosa opened this issue Oct 7, 2022 · 0 comments
Open

DB Host Connection Requires host.docker.internal #22

carlos-reynosa opened this issue Oct 7, 2022 · 0 comments

Comments

@carlos-reynosa
Copy link

I'm on on Linux and using 127.0.0 did not work for me. I had to change the DB host to host.docker.internal. Here is more info:

https://github.com/markshust/docker-magento#linux

Linux
Running Docker on Linux should be pretty straight-forward. Note that you need to run some post install commands as well as installing Docker Compose before continuing. These steps are taken care of automatically with Docker Desktop, but not on Linux.

Copy docker-compose.dev-linux.yml to docker-compose.dev.yml before installing Magento to take advantage of this setup.

The host.docker.internal hostname
The host.docker.internal hostname is used on Docker for Mac/Windows to reference the Docker daemon. On Linux, this hostname does not exist.

This hostname is hard-coded in the php.ini file. To make this hostname resolve, add "host.docker.internal:172.17.0.1" to the app.extra_hosts parameter of docker-compose.yml, replacing 172.17.0.1 with the result of:

docker run --rm alpine ip route | awk 'NR==1 {print $3}'
You must also create a new entry in your /etc/hosts file using the same IP:

172.17.0.1 host.docker.internal

I know it's not exactly about this package but it might help some of the projects users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant