couchbase / couchbase/docker

How to create bucket during build of the container?

Open
#27 13 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Dockerfile
Stars
155
Forks
154
Avg merge
10h 45m
Merged PRs (30d)
2

Description

Hi,
is it possible to configure couchbase inside a container?
I have docker-compose.yml with definition of our cloud (several apps in java, redis, dynamodb, ...).
I would need to configure couchbase db during build of the container because application in another container requires it configured to run.

I have tried to put inside my dockerfile something like this:
FROM couchbase/server:latest
RUN /opt/couchbase/bin/couchbase-cli bucket-create -c localhost -u Administrator -p administrator --bucket=default --bucket-type=couchbase --bucket-ramsize=128 --bucket-replica=1 --wait

But whatewer host i put into -c parameter (localhost, container IP, container ID), I always get [Errno 111] Connection refused. I tried to restart couchbase service before this command and sleep for 10 seconds but nothing helps.

I know that I can use docker exec from outside the container to create bucket (that works fine for me), but I would really like to run whole cloud by just "docker-compose up" command.

Am I missing something? Is there a way how to make this work?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Dockerfile command shown in the issue and the referenced docker-compose.yml. Read the Couchbase image startup behavior and how the compose services depend on readiness, then determine a supported way to create the bucket during docker-compose up. Done means the dependent application starts with the bucket configured without external docker exec.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, docker-compose
Domain
databases, devops, infrastructure
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.