# Trying to make docker image; fdbcli says database not created

**URL:** <https://forums.foundationdb.org/t/trying-to-make-docker-image-fdbcli-says-database-not-created/157>\
**Category:** Using FoundationDB\
**Created:** [April 20, 2018, 10:06pm UTC](https://forums.foundationdb.org/t/trying-to-make-docker-image-fdbcli-says-database-not-created/157 "2018-04-20T22:06:18Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jwatte](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/jwatte/32/77_2.png) [@jwatte](https://forums.foundationdb.org/u/jwatte)\
**Post date:** [April 20, 2018, 10:06pm UTC](https://forums.foundationdb.org/t/trying-to-make-docker-image-fdbcli-says-database-not-created/157/1 "2018-04-20T22:06:18Z")

</div>

I am a brand new user!

I’m trying to set up a foundationdb docker image to run the server, exposing port 4500 to the local machine.

I’ve installed server and client using the `.deb` packages from the download page, as part of the `Dockerfile` setting up the server container.

While I can get the server to run, when I try to interact with it, I get this error (using fdbcli inside the docker container):

```
fdb> status

Using cluster file `/etc/foundationdb/fdb.cluster'.

The coordinator(s) have no record of this database. Either the coordinator
addresses are incorrect, the coordination state on those machines is missing, or
no database has been created.

  127.0.0.1:4500 (reachable)

fdb>

```

I looked at the tutorials, but they all assume that a database has been properly created and set up.

The server is started as:

`sudo fdbserver -C /etc/foundationdb/fdb.cluster -d /var/lib/foundationdb/data/ -L /var/log/foundationdb/ -p 127.0.0.1:4500 -l 0.0.0.0:4500`

(This runs inside the container)

What’s likely to be the problem here, and more specifically where can I find the necessary information to unblock myself? (I e, “the docs” is not a good answer; tries that – where specifically in the docs?)

---

<div class="post-metadata">

**Author:** ![alloc](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/alloc/32/9_2.png) [@alloc](https://forums.foundationdb.org/u/alloc)\
**Post date:** [April 20, 2018, 10:51pm UTC](https://forums.foundationdb.org/t/trying-to-make-docker-image-fdbcli-says-database-not-created/157/2 "2018-04-20T22:51:33Z")

</div>

It looks like the problem is that the cluster hasn’t been “configured”. Each FDB cluster needs to be told some configuration information about what kind of redundancy mode it should be using, what storage engine, etc. We have detailed information about [configuration](https://apple.github.io/foundationdb/configuration.html) in our documentation.

For local development, you’ll probably want to run:

```auto
fdbcli --exec "configure new single memory ; status"

```

This configures a new database with single replication (as good as you can get with a single instance) and it uses the memory storage engine. (All data are still durable in a memory engine, but the dataset also must fit in memory and is not optimized for quick recovery.) You could substitute “ssd” for “memory” and that would also probably be fine. Most of our client installers do this transparently behind the scenes, so if you do have the debian package, if you so desired, you could find the script where this is invoked, though that’s probably not worth the effort, tbh.

---

<div class="post-metadata">

**Author:** ![jwatte](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/jwatte/32/77_2.png) [@jwatte](https://forums.foundationdb.org/u/jwatte)\
**Post date:** [April 21, 2018, 12:26am UTC](https://forums.foundationdb.org/t/trying-to-make-docker-image-fdbcli-says-database-not-created/157/3 "2018-04-21T00:26:19Z")

</div>

> [@alloc](#):
>
> fdbcli --exec “configure new single memory ; status”

Thanks! I had tried running `configure new memory` (after reading the meager output of `help`) but that didn’t work.  
`configure new single memory` seems to work great!  
That should probably go somewhere early in the “how to install and use” documentation path …

---

<div class="post-metadata">

**Author:** ![dave](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/dave/32/89_2.png) [@dave](https://forums.foundationdb.org/u/dave)\
**Post date:** [April 21, 2018, 3:35pm UTC](https://forums.foundationdb.org/t/trying-to-make-docker-image-fdbcli-says-database-not-created/157/4 "2018-04-21T15:35:38Z")

</div>

I’m kind of puzzled why you had to do this yourself; shouldn’t the debian packages have done it during the docker build process? Maybe there is something wrong with the Dockerfile.

---

<div class="post-metadata">

**Author:** ![dch](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/dch/32/473_2.png) [@dch](https://forums.foundationdb.org/u/dch)\
**Post date:** [January 25, 2019, 2:00pm UTC](https://forums.foundationdb.org/t/trying-to-make-docker-image-fdbcli-says-database-not-created/157/5 "2019-01-25T14:00:42Z")

</div>

> [@alloc](#):
>
> fdbcli --exec “configure new single memory ; status”

FWIW the FreeBSD port doesn’t do this either. If I am adding a new cluster node, would I also want to do this?

Also, I’d happily contribute this as a “getting started” guide if you can point out where you’d like that to live.

---

<div class="post-metadata">

**Author:** ![alexmiller](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/alexmiller/32/326_2.png) [@alexmiller](https://forums.foundationdb.org/u/alexmiller)\
**Post date:** [January 31, 2019, 5:38pm UTC](https://forums.foundationdb.org/t/trying-to-make-docker-image-fdbcli-says-database-not-created/157/6 "2019-01-31T17:38:45Z")

</div>

> [@dch](#):
>
> If I am adding a new cluster node, would I also want to do this?

This is only necessary when creating the database the first time. If you’re adding a new node to an existing cluster, you would incredibly not want to do this, as it would wipe your database. (And, if I recall correctly, fdbcli doesn’t let you do `configure new` on a running database anyway.)

> [@dch](#):
>
> Also, I’d happily contribute this as a “getting started” guide if you can point out where you’d like that to live.

`documentation/sphinx/source/getting_started.rst` ?

---

<div class="post-metadata">

**Author:** ![shane](https://avatars.discourse-cdn.com/v4/letter/s/dbc845/32.png) [@shane](https://forums.foundationdb.org/u/shane)\
**Post date:** [February 8, 2019, 3:47pm UTC](https://forums.foundationdb.org/t/trying-to-make-docker-image-fdbcli-says-database-not-created/157/7 "2019-02-08T15:47:01Z")

</div>

I’m trying to use the [Docker image](https://github.com/apple/foundationdb/tree/master/packaging/docker) in my integration tests. Unfortunately, the Docker container doesn’t initialise a new database on startup.

How can I do the equivalent of `fdbcli --exec “configure new single memory"` for the Docker container? I can’t run `docker exec` from my test suite. Is there a way to configure the the database at image build time?

---

<div class="post-metadata">

**Author:** ![shane](https://avatars.discourse-cdn.com/v4/letter/s/dbc845/32.png) [@shane](https://forums.foundationdb.org/u/shane)\
**Post date:** [February 12, 2019, 1:13pm UTC](https://forums.foundationdb.org/t/trying-to-make-docker-image-fdbcli-says-database-not-created/157/8 "2019-02-12T13:13:54Z")

</div>

I’ve figured it out. If anybody is using FoundationDB with Scala, here’s how you can write integration tests using the foundationdb/foundationdb Docker image: [https://gist.github.com/vyshane/3ac679d1c57d194e00ed004b27d5133c](https://gist.github.com/vyshane/3ac679d1c57d194e00ed004b27d5133c)
