Skip to content

How to build and run in Docker

Sawood Alam edited this page May 6, 2017 · 23 revisions

This document describes the process of building the OpenWayback from source and running, all in the Docker environment. This can be very handy for development and testing in different environments. Generated Docker image is kept minimal which makes it suitable for running in production as well.

Requirements

Docker (version 17.05 or later is required for building the image).

Building

Acquire the source code.

$ git clone https://github.com/iipc/openwayback.git
$ cd openwayback

Make any changes to the source code if needed. Then build the docker image.

$ docker image build -t openwayback .

This will download dependencies, compile the code, run tests, package, and place necessary components in appropriate places to build a minimal Docker image with the name openwayback. This process may take a while (depending on the network bandwidth and processor speed).

Running

The default configuration of the OpenWayback uses the automatic BDB Indexer and expects WARC files at ${WAYBACK_BASEDIR}/files1/ or ${WAYBACK_BASEDIR}/files2/. By default the WAYBACK_BASEDIR is set to /data volume in the Docker image. Create necessary directory structure on the host machine for testing and populate it with some test files.

$ mkdir -p /tmp/owb/files1
$ cp /path/to/sample/*.warc /tmp/owb/files1/

Run a Docker container with appropriately mounted volumes and port mapping. By default the container would run the Tomcat server.

$ docker container run -it --rm -v /tmp/owb:/data -p 8080:8080 openwayback

Once the WARC files are indexed, they should be ready for lookup at http://localhost:8080/.

Clone this wiki locally