Couchdb docker image: how to pre-populate database

I am creating a couchdb docker image with the following content pre-populated:

  1. User name/password
  2. Three databases
  3. Update handler script for the above 3 databases.

I am able to do #1, but not 2 and 3.

I created an instance of couchdb with its baseline image and then created a database and added a update handler script in it. (Note - while starting couchdb instance I am using a volume)

I then did a docker commit and expected to see this database+update handler script populated in the docker image itself. However, I see it is blank.

What could be the issue here?

I understand the database and userid’s are stored in the following folder: /opt/couchdb/data

From what I understand, docker commit saves everything other than the content you store in a volume. So, the above data stored in /opt/couchdb/data should be committed to the docker image.

Any inputs on what the issue could be. Is it possible to explicitly force docker commit to save the contents of the /opt/couchdb/data folder?

Hi @anandri4forums,

Do you actually mean CouchDb or Couchbase? If you are looking for CouchDb help, this is the wrong forum. Couchbase and CouchDb are very different.