Skip to content

Instantly share code, notes, and snippets.

@KAIYOHUGO
Last active August 21, 2021 03:26
Show Gist options
  • Save KAIYOHUGO/c8f751e9985e5cea05c2faa61382995e to your computer and use it in GitHub Desktop.
Save KAIYOHUGO/c8f751e9985e5cea05c2faa61382995e to your computer and use it in GitHub Desktop.
Dgraph docker build file (arm)

How to use it

dgraph

you will need

  • build_dgraph.dockerfile
  • build_dgraph.sh
# then build
sh build_dgraph.sh

and wait 10~20min (on raspberry pi 4 8gb)

ratel

you will need

  • build_ratel.dockerfile
  • build_ratel.sh
# then build
sh build_ratel.sh

and wait 5~10min (on raspberry pi 4 8gb)

# compile dgraph
FROM golang AS build
RUN cd / &&\
apt-get update &&\
apt-get install bzip2 -y &&\
go get -u -v google.golang.org/grpc &&\
git clone --depth 1 https://github.com/dgraph-io/dgraph.git --branch $(curl --silent "https://api.github.com/repos/dgraph-io/dgraph/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")') &&\
cd /dgraph &&\
make dgraph
# contain to run graph
FROM ubuntu AS dgraph
RUN apt-get update
COPY --from=build /dgraph/dgraph/dgraph /bin/dgraph
FROM dgraph
sudo docker build -t dgraph/dgraph -f ./build_dgraph.dockerfile .
FROM golang AS build
RUN cd / &&\
apt-get update &&\
apt-get install chromium npm -y &&\
git clone --depth 1 https://github.com/dgraph-io/ratel.git --branch $(curl --silent "https://api.github.com/repos/dgraph-io/ratel/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")') &&\
cd /ratel &&\
bash ./scripts/build.prod.sh
FROM ubuntu AS ratel
COPY --from=build /ratel/build/ratel /ratel
COPY --from=build /ratel/client/public /client/public
RUN apt-get update &&\
ln -s /ratel /usr/bin/dgraph-ratel
FROM ratel
sudo docker build -t dgraph/ratel -f ./build_ratel.dockerfile .
version: "3.0"
services:
zero:
image: dgraph/dgraph:latest
volumes:
- /tmp/data:/dgraph
ports:
- 5080:5080
- 6080:6080
restart: on-failure
command: dgraph zero --my=zero:5080
alpha:
image: dgraph/dgraph:latest
volumes:
- /tmp/data:/dgraph
ports:
- 8080:8080
- 9080:9080
restart: on-failure
command: dgraph alpha --my=alpha:7080 --zero=zero:5080
relat:
image: dgraph/ratel:latest
ports:
- 8000:8000
restart: on-failure
command: dgraph-ratel
sudo docker-compose -f docker-compose.dgraph_standalone.yaml up -d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment