Comments (5)
@heriisei would love to have a look at your script. i am currently having a hard time finding a solution to that
from docker-host.
which os do you use? you may need to bind your database port to 0.0.0.0
or the bridge network gateway in addition to localhost(127.0.0.1
), to allow connections from docker host container.
By default most database server do bind only to 127.0.0.1
Use following docker command to get the bridge network gateway IP address
docker network inspect bridge --format='{{( index .IPAM.Config 0).Gateway}}'
from docker-host.
see README.md Linux Section -> https://github.com/qoomon/docker-host/blob/master/README.md#%EF%B8%8F-on-linux-systems
from docker-host.
@qoomon I'm using Linux Ubuntu. My bad, I used to write the bind-address in a wrong file (/etc/mysql/my.cnf), I just realized that my MySQL config file is /etc/mysql/mysql.conf.d/mysqld.cnf.
So I rewrite the bind-address from 127.0.0.1 to 0.0.0.0, because it didn't work with multiple IP address value configuration.
And now the connection between the container and my host database is pretty well established.
I would glad to know if there is any workaround to automatically detect the dockerhost container Gateway IP address and then run a bash command to add a new firewall rule to allow that gateway IP address?
For now, I do manually run docker inspect | grep Gateway to get the IP and manually run the firewall command via terminal, every time after I run docker-compose up --build.
Thank you so much.
Update:
Nevermind, I already make a simple bash script to run after docker-compose, to updating the UFW firewall rule.
Thank you!
from docker-host.
maybe you can contribute your script, that would be nice because you are not the first person having these troubles.
from docker-host.
Related Issues (20)
- weird IP returned by getent HOT 7
- pass docker socket and auto determine host ip HOT 6
- Cant find dockerhost HOT 6
- Setup Home Assistant on Mac using Docker-Host HOT 7
- Is it possible to use with Docker Swarm ? HOT 2
- Cant get it running on with docker compose 3.7 on ubuntu linux HOT 4
- How to forward to other server/ip? HOT 1
- Build for ARM HOT 8
- Pointing custom hostname to docker-host HOT 2
- setup correctly connection from container to Docker API HOT 6
- allow access to other resources on host network? HOT 4
- Can't get it to work with `sam local` HOT 3
- Latest Update Causes Issues on Docker For Mac HOT 8
- docker-host fails to start sometimes HOT 2
- Docker-host container takes ~10 seconds to shut down in docker compose HOT 4
- Container does not work on linux rootless HOT 5
- Startup error on macOS HOT 10
- Add platform ppc64le support HOT 2
- Depreciated? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-host.