1
votes

I am running couchbase on docker. My machine: ubuntu 16.04

I've a Couchbase image. I'm running some curl commands to configure the Couchbase server and to create an admin user. Problem is, curl fails with error message Failed to connect to 127.0.0.1 port 8091: Connection refused. netstat does not show that port 8091 on the localhost is listening. those work! What am I missing?

I copy out this script : https://github.com/madhur/couchbase-docker/blob/master/couchbase/configure-node.sh

here is my Dockerfile all content:

FROM couchbase:community-4.0.0

COPY configure-node.sh /opt/couchbase

CMD ["/opt/couchbase/configure-node.sh"]

I changed Docker file From line like that: FROM couchbase/server

Then the connection error is finished. then I see this error: http://paste.ubuntu.com/23065389/

I didn't understand why and How can I fix it?

1
you should provide more information about the content of your dockerfile so people can troubleshoot your problem. - silgon
Are you forwarding the ports using -p? Complete instructions at docs.docker.com/engine/examples/couchbase. - Arun Gupta
I added Dockerfile content to question. Should I forward the ports? I am setting ports in docker-compose.yml only. - pronto
Yes, container ports need to be forwarded to host port. You can also follow the instructions at github.com/arun-gupta/docker-images/tree/master/couchbase - Arun Gupta
Sorry I think we are forwarding ports in docker-compose.yml: ports: - "8091-8093:8091-8093" - "11210:11210" - pronto

1 Answers

0
votes

With the latest version you should not face that issue, it's pretty seamless.

"docker run -d --name mycouchdb -p 8091-8094:8091-8094 -p 11210:11210 couchbase" 

will create a container with name mycouchdb and if you run docker logs mycouchdb then you should see that in order to access the DB URL, its on http://:8091