I have a python test where I’m seting up a docker container running Couchbase server and I cannot access that Couchbase server via Couchbase Python SDK (2.0). I’m on Mac OSX and running docker via boot2docker. I’ve read thet this configuration isn’t very good but maybe there is a way it can be done. I have a docker image based on the official Couchbase Server docker image with initialized first cluster and default bucket. Now from my host I’m running the python test where I’m trying to upsert a document into Couchbase:

HOST here is my boot2docker IP, 192.168.59.103, whereas the Couchbase server host IP is something like 172.17.0.1 and the host name is random docker ID 4e4c8cae1d91.

I am able to navigete to Couchbase Server in my browser on boot2docker:8091 thanks to port forwarding, but I suppose I need to have a public IP on the docker container to be able to connecto to it with Couchbase python SDK.

I suppose I can do all I want with just using the Couchbase REST API via port forwarding, but I thought that the SDK would be a better approach.

So my questions are:

Is it possible to connect to Couchbase server via python SKD in such scenario?

I tried again (as I did earlier) few solutions from the link you provided and this time I managed to connect with the Couchbase SDK to the Couchbase Server inside the docker container. It worked with —net=host option. I was able to store documents in Couchbase with its python SDK using boot2docker hostname.