Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(standalone): Add DGRAPH_VERSION to build different Dgraph versions for standalone image. #6082

Merged
merged 6 commits into from
Jul 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion contrib/standalone/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM dgraph/dgraph:latest
ARG DGRAPH_VERSION=latest
FROM dgraph/dgraph:${DGRAPH_VERSION}
LABEL MAINTAINER="Dgraph Labs <[email protected]>"

# Ratel port
Expand Down
13 changes: 0 additions & 13 deletions contrib/standalone/Dockerfile.master

This file was deleted.

39 changes: 37 additions & 2 deletions contrib/standalone/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,38 @@
.PHONY: build
# Build dgraph/standalone image
# Usage:
#
# For latest tag:
# Build, based on dgraph/dgraph:latest:
# make
# Push:
# make push
#
# For $TAG tag, set DGRAPH_VERSION:
# Build, based on dgraph/dgraph:latest:
# make DGRAPH_VERSION=$TAG
# Push:
# make DGRAPH_VERSION=$TAG push
#
# Examples
# Build and push latest:
# make
# make push
#
# Build and push master:
# make DGRAPH_VERSION=master
# make DGRAPH_VERSION=master push
#
.PHONY: all build push version

export DGRAPH_VERSION ?= latest

all: build version

build:
docker build -t dgraph/standalone:latest .
./hooks/build

push:
docker push dgraph/standalone:$(DGRAPH_VERSION)

version:
docker run dgraph/standalone:$(DGRAPH_VERSION) dgraph version
3 changes: 3 additions & 0 deletions contrib/standalone/hooks/build
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
# Used for Makefile or Docker Hub builds
docker build -t dgraph/standalone:${DGRAPH_VERSION} --build-arg DGRAPH_VERSION=${DGRAPH_VERSION} .