-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: Makefile to build Dgraph inside docker container. (#6423)
The script is useful for situations in which the host system creates a binary that's incompatible with the docker container (e.g different versions of glibc).
- Loading branch information
Showing
5 changed files
with
52 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
install: | ||
@docker-compose up | ||
@sudo chown $(USER) ../../dgraph/dgraph | ||
@mv ../../dgraph/dgraph $(GOPATH)/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Docker build script | ||
|
||
This directory contains a Makefile that can be used to build Dgraph inside the | ||
official Dgraph Docker container. This is useful for situations when the host | ||
system cannot be used to build a binary that will work with the container (for | ||
example, if the host system has a different version of glibc). | ||
|
||
## Usage | ||
|
||
Run `make install` in this directory. The script will ask you for your password | ||
in order to change ownership of the compiled binary. By default, files written | ||
by Docker will be owned by root. This script also takes care of moving the | ||
binary to $GOPATH/bin. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
export DEBIAN_FRONTEND=noninteractive | ||
apt-get update | ||
apt-get install -y build-essential git golang | ||
cd /dgraph/dgraph | ||
make |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
version: "3.5" | ||
services: | ||
build: | ||
image: dgraph/dgraph:latest | ||
container_name: build | ||
working_dir: /data/build | ||
labels: | ||
cluster: test | ||
service: build | ||
volumes: | ||
- type: bind | ||
source: ../../ | ||
target: /dgraph | ||
command: /dgraph/contrib/docker-build/build.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters