Closed Afrowave closed 5 years ago
I'm not familiar with Docker Toolbox, but https://stackoverflow.com/questions/35496273/port-mapping-in-docker-on-mac-osx-installed-with-docker-toolbox suggests that mapping of container ports to host ports does not work the same way. From what I understand, Docker Toolbox creates a Linux virtual machine using VirtualBox and then runs the containers inside that. This means that any references to services being on localhost:<port>
will instead need to be changed to <IP of Docker VM>:<port>
and you'll need to set appropriate environment variables (DATABASE_URL
, ELASTICSEARCH_URL
, BROKER_URL
) to point to these IPs.
An alternative option is to set up a Linux VM and run h inside that, following the setup instructions for a Linux development environment.
If your Postgres instance needs a password, you can configure that in the DATABASE_URL
env var. See https://stackoverflow.com/questions/3582552/postgresql-connection-url
Thanks @robertknight . Let me have a look at that and I will add something in the docs for users of Docker Toolbox.
I have a pre-2010 Mac Pro (old CPUs) so I cannot use the Docker on Mac app. I use the Docker Toolbox to spin my containers.
Possibly because I am not using the Docker on the Mac app, I am found that if there is a default PostgreSQL installation on the system that is bound to the
localhost
, binding the docker container ports to the localhost ports does not work for me on Mac OS X 10.11.6. In the process, one cannotmake dev
successfully.Steps to reproduce
I have installed and used the Installing the system dependencies on macOS instructions. Basically here is my containers.
Expected behaviour
At this point I expect to
make dev
and go to mylocalhost:5000
andlocalhost:9200
and see the installation and an Elasticsearch JSON object .Actual behaviour
On
make dev
, I get a postgresql error:No password supplied.
But on the postgres logs:
Everything looks okay.
Additional details
I decided to see which
postgres
I am looking at. I have an old PostgreSQL 9.5 on my local machine. This was meant to be replaced by the Hypothesis Dockerpostres
container.The
localhost
postgres is:I created the
htest
database, to make sure I was on the right track. The Dockerpostgres
is:From the installation part of the docs: "You should also be able to visit your Elasticsearch service by opening http://localhost:9200/ in a browser, and connect to your PostgreSQL by running psql postgresql://postgres@localhost/postgres (if you have psql installed)."
At this point, the ElasticSearch container is not showing up on the
localhost
though I have nothing else on port 9200:When I change the binding of the ports in
docker-compose.yml
and free the Docker containers from thelocalhost
, I get:So the services are running and
docker-compose logs rabbit
works as expected as well. After looking around, I foundlocalhost
is tied up to many things.Browser/system information
Mac Pro 2,1 Mac OS X 10.11.6 Docker 17.07.0-ce, build 8784753
@robertknight is there anything I am missing here?