Unable to get Couchbase to run in docker


I’ve tried these tutorials on docker:

But when I go to run the image and do a “docker ps -a”, I see the following status:
“/entrypoint.sh /opt…” 2 seconds ago Exited (1) 10 seconds ago

I need someone’s help with making sure that my configuration is working properly.

1 Like

Hi Adrian,

Are you having problems with the standard Couchbase image, or a custom one? If a custom one, can you post your configuration?

Also, can you post the full text of the status? And did you make configure.sh executable before building your docker image? (That’s one small issue I hit while reproducing the steps in the first blog you referenced.)

hi @hod.greeley,

Here’s the config in my Dockerfile:

FROM couchbase:community-5.1.1
COPY configure.sh /opt/couchbase
CMD ["/opt/couchbase/configure.sh"]

And this is what’s in my confgure.sh:

set -m

/entrypoint.sh couchbase-server &

sleep 15

curl -v -X POST -d memoryQuota=512 -d indexMemoryQuota=512

curl -v -d services=kv%2cn1ql%2Cindex




fg 1

I noticed an issue in this post, https://www.thepolyglotdeveloper.com/2017/04/using-couchbase-docker-deploying-containerized-nosql-cluster/ with:

–network=“docker_default” \

But in the video, Nic corrects the issue.

1 Like

Here’s the run command that I’m using:

docker run -d \
    -p 8091-8093:8091-8093 \
    -e COUCHBASE_BUCKET=default \
    --network="bridge" \
    --name couchbaseDB myCouchImage

Here’s full status:

CONTAINER ID        IMAGE                 COMMAND                  CREATED             STATUS                      PORTS               NAMES
f4142623a6e7        myCouchImage   "/entrypoint.sh /opt…"   15 seconds ago      Exited (1) 13 seconds ago                       couchbaseDB


The issue is with the code in the configure.sh. When I removed the reference to the file in Dockerfile, I’m able to run the container.

I suspect, the problem is with this statement:

/entrypoint.sh couchbase-server &

Yes, Nic used a technique of putting server in the background while the configuration (curl) steps run. Then moving server to the foreground (fg 1). He has all the configuration built into the docker script itself. I believe he found some issues with older versions of docker.

He has that 15 second pause hardcoded. I wonder if that’s causing your problem. That’s just a guess at how long to wait for Couchbase to be ready.

I used a different approach. You can see it in in this code https://github.com/couchbaselabs/connect-fall-2017-demo and described in this post https://blog.couchbase.com/simplified-couchbase-server-cluster-creation-via-docker/

I finally got a chance to resolve the problem. The issue was with the execution permission with configure.sh.

@nraboy video explains the issue and how to fix it with

chmod +x configure.sh


1 Like