Skip to content

Requirements: Using Docker

Kinan Dak Albab edited this page Apr 26, 2023 · 1 revision

You will need to install Docker on your machine. You then need to build the docker container image. This step may take anywhere between 5-30 minutes, depending on your system and internet connection.

cd <K9DB_DIR>  # navigate to repo root directory
docker build -t k9db/latest .  # build image and name it k9db/latest

After the image is built, you can start it the first time using. This will also perform some one-time configurations needed to build k9db.

docker run --mount type=bind,source=$(pwd),target=/home/k9db --name k9db -d -p 3306:3306 -p 10001:10001 -t k9db/latest

You can check that the one-time configuration is done by looking at the container logs, and looking for the message Configuration done!.

docker logs k9db

After configuration is done, you can open a terminal inside your container.

docker exec -it k9db /bin/bash
$ # now you are inside the container
$ # validate container is setup properly
$ cd /home/k9db
$ ls  # you should see the contents of this repo
$ ...
$ exit  # exit the container when you are done.  

You can stop the container and restart it as you wish using.

docker stop k9db
docker start k9db

Note: the container mounts the repo from your host filesystem rather than copies it. You can think of this as making a symbolic link to its content. Any changes you make to the contents of the repo inside the container will be visible in your host filesystem and vice-versa.

We tested this using Docker version 20.10.19, build d85ef84.