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

mysql database connection using docker #1429

Open
bbrendon opened this Issue Jan 6, 2019 · 5 comments

Comments

Projects
None yet
4 participants
@bbrendon
Copy link

bbrendon commented Jan 6, 2019

I'm trying to get the octobox docker container to connect to mysql. I poked around in the code a bit and I'm not sure exactly how it works but from what I can tell mysql would only maybe work as a database URL. I tried removing all the database entries and added this:

DATABASE_URL="mysql2://octobox:asdf9jf2l@1.1.1.1/octobox"

I get an error. nc: getaddrinfo: Name does not resolve.

But I went into the docker container and nc'ed to the database server without an issue so it appears the network isn't actually the problem.

@andrew

This comment has been minimized.

Copy link
Member

andrew commented Jan 6, 2019

@bbrendon

This comment has been minimized.

Copy link

bbrendon commented Jan 6, 2019

Yea, I don't know enough about docker to submit a PR to support those. Maybe what I'm asking is more of a feature request.

@andrew

This comment has been minimized.

Copy link
Member

andrew commented Jan 7, 2019

@bbrendon I believe this is more like a specific configuration in docker for your setup rather than a feature, I'm also not that familiar with docker to be able to advise, will see if anyone for experienced can help.

@kivikakk

This comment has been minimized.

Copy link

kivikakk commented Jan 10, 2019

You could consider having MySQL listen on a socket, then bind mount the socket file into the container?

@j-mcnally

This comment has been minimized.

Copy link

j-mcnally commented Jan 10, 2019

Why do expect MySQL to be at 1.1.1.1?

You’d be better off starting MySQL in a named container like mysql and connecting mysql and Octobox to a network and then using the container name as the host name. So you’d just punch in mysql rather than 1.1.1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment