Sebastiaan f9c0922b2f
Examples folder default permission
When running the container and building the examples, the following error occurs:
Error: EACCES: permission denied, open '/home/node/examples/browser/browser-webpack-example/bundle.js'

Commands used:
```
docker build -t orbit-db -f docker/Dockerfile . --no-cache
docker run -ti --rm orbit-db npm run build:examples
```
2019-05-15 16:19:46 +02:00
..
2019-05-15 16:19:46 +02:00

Running OrbitDB code in containers

Docker is a tool for running software in containers ie. OS-level virtualization. This directory contains the needed configuration files to:

  • Build base Docker images for OrbitDB

Base Docker image

Dockerfile defines OrbitDB base images that are based on official node.js -image.

Build local images with command (in repository root):

docker build -t orbit-db -f docker/Dockerfile .

After building local image, run node.js-examples inside container:

docker run -ti --rm orbit-db npm run examples:node

Why would you want to run OrbitDB in container?

Containers are nice because as software execution environments they are:

  • Reproducible, which helps testing and development because you can revert the container to original state by destroying it and creating it again,
  • Isolated, which guarantees that external factors like npm versions, the operating system version, or other installed software like native compilers do not affect the execution.

They also make implementing virtualized networks for testing and benchmarking easier, which may help projects that use OrbitDB.

Tested versions

  • Docker 1.13.1 (Linux 4.17.5-100.fc27.x86_64)
  • Docker 18.06.1-ce (Linux 4.17.5-100.fc27.x86_64)