Skip to content

Setup BNote with Docker

Matti Maier edited this page Oct 1, 2020 · 2 revisions

BNote comes with a Dockerfile and a docker-compose.yml file that allows you to set up a basic docker environment to start BNote quickly. Here is a quick start guide on how to do this.

Quick start

This guide assumes you have docker installed on your system. You can validate that by opening a terminal/command prompt and enter docker --version. If it shows something like this, you're good: Docker version 19.03.13, build 4484c46d9d.

Let's get started:

  1. Clone the BNote repository to your disk: git clone https://github.com/mattimaier/bnote.git. Alternatively you can just download the latest release and unzip that on your disk.
  2. In your terminal/comand promt change to the BNote directory, e.g. cd /home/myuser/git/bnote
  3. Change the docker-compose.yml file with a sensible password for the database ROOT and bnote user.
  4. Build the BNote docker image: docker build . This could take a bit...
  5. Start two containers (one is bnote itself, the other one the database) using docker-compose: docker-compose up
  6. Wait for the entire thing to start. Now enter in your browser: http://localhost/BNote

Troubleshoot

Quite a few things can go wrong. Here are some common issues:

Browser doesn't load BNote

At first try http://localhost/bnote with lower case letters - just in case. Then it could be that port 80 is already bound. Stop the containers by entering docker-compose stop, then change the external port in the docker-compose.yml file to something that is not used on your machine already, e.g. 8088 and bring the containers up again.

You get the following error when you start BNote:

Warning: mysqli_connect(): (HY000/2002): No such file or directory in /var/www/html/BNote/src/data/database.php on line 35 This is caused by the database driver of BNote not being able to connect to the database. Please start the setup again and make sure your BNote/bnote/config directory has no database.xml file yet: http://localhost/BNote/install.php