Can't connect to couchbase server running in a docker container with sync gateway

I’m trying to deploy couchbase server (CE) in a docker container, and everything is working fine (I can access to the console through port 8091), except that I can’t connect an instance of sync gateway (running on a separate aws instance) to the server running in that container. When I try to connect the same sync gateway instance to a couchbase instance running on the same server, but not in a docker container it works fine

Sync gateway appears to be unable to connect to port 8092 when couchbase is in the container. This is the error I’m getting when trying to connect:

_time=2017-06-28T13:00:14.445+00:00 _level=INFO _msg= Trying with selected node 0
2017-06-28T13:00:14.446Z WARNING: Error installing Couchbase design doc: Put dial tcp getsockopt: connection refused -- db.installViews.func1() at database.go:609
2017-06-28T13:00:14.446Z Debug: RetryLoop retrying Attempt to install Couchbase design doc bucket : sync_gateway after 10 ms.

And here are the commands I’m using to install couchbase server and sync gateway respectively:

docker run -d --name cb -p 8091-8094:8091-8094 -p 11210:11210 couchbase/server:community-4.5.1

docker run --name sg -p 4984:4984 -v /tmp:/tmp/config -d couchbase/sync-gateway /tmp/config/sg-config.json

Here’s my sync gateway file:

  "log": ["*"],
  "databases": {
    "db": {
      "server": "http://couchbase-url:8091",
      "password" : "my-password",
      "sync": `
      "users": { "GUEST": { "disabled": false, "admin_channels": ["*"] } }

I’m sure that my security settings allow access to port 8092 on the server, but can’t figure why the same port would be blocked in a docker container given that I specify access to it.


Hi @sam.wilks92,

Can you reproduce this problem locally? Or is only when using AWS? I’m just trying to narrow down if this is a docker issue, an AWS issue, a Couchbase Server issue, or a Sync Gateway issue.