Skip to content

Commit eb47a68

Browse files
author
Dan Compton
committed
Adds makefile that uses build-container
Just move server into /cmd. Add rocksdb deps to Dockerfile Fix tags Move server into cmd Ignore ./target Adds makefile that uses build-container Just move server into /cmd. Add rocksdb deps to Dockerfile Fix tags Move server into cmd Delete target folder
1 parent 0703aaf commit eb47a68

28 files changed

+44
-32
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
./target

Dockerfile

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,10 @@
11
# Dockerfile for DGraph
2-
3-
FROM golang:1.6.2
4-
MAINTAINER Manish Jain <manishrjain@gmail.com>
5-
6-
# Get the necessary packages.
7-
RUN apt-get update && apt-get install -y --no-install-recommends \
8-
git \
9-
libbz2-dev \
10-
libgflags-dev \
11-
libsnappy-dev \
12-
zlib1g-dev \
13-
&& rm -rf /var/lib/apt/lists/*
14-
15-
# Install and set up RocksDB.
16-
RUN mkdir /installs && cd /installs && \
17-
git clone --branch v4.2 https://github.com/facebook/rocksdb.git
18-
RUN cd /installs/rocksdb && make shared_lib && make install
19-
ENV LD_LIBRARY_PATH "/usr/local/lib"
20-
21-
# Install DGraph and update dependencies to right versions.
22-
RUN go get -v github.com/dgraph-io/dgraph/... && \
23-
go build -v github.com/dgraph-io/dgraph/... && \
24-
go test github.com/dgraph-io/dgraph/... && echo "v0.2.3"
2+
FROM gliderlabs/alpine:3.2
3+
MAINTAINER Dan Compton <dan@opsee.co>
254

265
# Create the dgraph and data directory. These directories should be mapped
276
# to host machine for persistence.
287
RUN mkdir /dgraph && mkdir /data
8+
RUN apk add --update bash ca-certificates
9+
10+
COPY target/linux/amd64/bin/* /

Makefile

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
PROJECT := github.com/dgraph-io/dgraph
2+
3+
# docker tag is DGRAPH_VERSION unless DGRAPH_VERSION is set
4+
DGRAPH_VERSION := $(shell git rev-parse --short HEAD)
5+
GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
6+
GITUNTRACKEDCHANGES := $(shell git status --porcelain --untracked-files=no)
7+
ifneq ($(GITUNTRACKEDCHANGES),)
8+
GITCOMMIT := $(DGRAPH_VERSION)-dirty
9+
endif
10+
11+
all: clean build
12+
13+
clean:
14+
rm -fr target bin pkg
15+
16+
build:
17+
docker run -v `pwd`:/gopath/src/$(PROJECT) -e PROJECT=$(PROJECT) dancompton/build-go
18+
docker build -t dancompton/dgraph:${DGRAPH_VERSION} .
19+
docker tag dancompton/dgraph:${DGRAPH_VERSION} dancompton/dgraph:latest
20+
21+
docker-push:
22+
docker push dancompton/dgraph:latest
23+
24+
fmt:
25+
@gofmt -w .
26+
27+
.PHONY: clean all
28+
.PHONY: $(BINARIES)
29+
.PHONY: $(CMDS)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)