Public Repository

Last pushed: 2 years ago
Short Description
Cayley and nothing but cayley
Full Description

This project puts Cayley in scratch docker container. It is available on Docker Hub and can be pulled using the following command.

docker pull alectolytic/cayley

You will note that this is a tiny image.

$ docker images | grep docker.io/alectolytic/cayley
docker.io/alectolytic/cayley    latest  9f8c078ba15a    17 minutes ago  13.34 MB

Persisted data deployment

In this example we deploy cayley with data persisted via a data container and mongo db as a backend.

Initialization

# create data container
docker create  --entrypoint=_ -v /data -v /data/db -v /log --name cayley-data scratch

# start mongo container
docker run -d --volumes-from cayley-data --name cayley-mongo mongo

# initialize database
docker run --rm -it --name cayley \
  --volumes-from cayley-data \
  --link cayley-mongo:mongo \
  alectolytic/cayley init \
  -db="mongo" -dbpath="mongo:27017"

# start cayley as required
docker run -d --name cayley -p 64210:64210 \
  --volumes-from cayley-data \
  --link cayley-mongo:mongo \
  alectolytic/cayley http -host="0.0.0.0" \
  -db="mongo" -dbpath="mongo:27017"

Starting and stopping

You can start or stop cayley using the following command.

# Starting
docker start cayley-mongo cayley

# stopping
docker stop cayley cayley-mongo

Accessing data

You can access data from the data container using any container of your choice.

# using alpine (tiny busybox)
docker run --rm -it --volumes-from cayley-data alpine sh

# using fedora
docker run --rm -it --volumes-from cayley-data fedora:latest bash

Usage

Build

make

Show help

docker run --rm -it alectolytic/cayley -help

HTTP server with provided configuration file

docker run -d -name cayley -p 64210:64210 \
  -v /path/to/cayley.cfg:/cayley.cfg \
  alectolytic/cayley http -config="/cayley.cfg"

HTTP server with mongodb backend

# start mongo container
docker run -d --name cayley-mongo mongo

# start cayley
docker run -d -name cayley -p 64210:64210 \
    --link cayley-mongo:mongo \
    alectolytic/cayley http -host="0.0.0.0" \
      -db="mongo" -dbpath="mongo:27017"

HTTP server (foreground) with data from host

docker run --rm -it -p 64210:64210 \
  -v /path/to/data:/data \
  alectolytic/cayley http -host="0.0.0.0" \
    -db="memstore" -dbpath="/data/30kmoviedata.nq" -logtostderr=true
Docker Pull Command
Owner
alectolytic

Comments (0)