Build a docker image of the s2graph in the project's root directory
you can build images for each type of API Server
// s2graphql sbt "project s2graphql" 'set version := "latest"' docker // s2rest_play sbt "project s2rest_play" 'set version := "latest"' docker // s2rest_netty sbt "project s2rest_netty" 'set version := "latest"' docker
find local image is created correctly by using docker images
(optional) If you need to add extra jars in classpath, use environment variable ‘EXTRA_JARS’
docker run --name s2graph -v /LocalJarsDir:/extraJars -e EXTRA_JARS=/extraJars -dit s2graph/s2graphql:latest ...
Run MySQL and HBase container first.
cd dev_support
docker-compose build
Run graph container
docker-compose up -d
S2Graph should be connected with MySQL at initial state. Therefore you have to run MySQL and HBase before running it.
In OS X, the docker container is running on VirtualBox. In order to connect with HBase in the docker container from your local machine. You have to register the IP of the docker-machine into the /etc/hosts
file.
Within the docker-compose.yml
file, I had supposed the name of docker-machine as default
. So, in the /etc/hosts
file, register the docker-machine name as default
.
ex) 192.168.99.100 default
In order to develop and test S2Graph. You might be want to run S2Graph as dev
mode on your local machine. In this case, the following commands are helpful.
# docker-compose up -d graph_mysql
# sbt "project s2rest_play" run -Dhost=default
# sbt test -Dhost=default