-
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(standalone): Add DGRAPH_VERSION to build different Dgraph versi…
…ons for standalone image. (#6082) (#6238) The standalone images build from the same tags as the `dgraph/dgraph` image. To build and push the v20.03.4 and latest `dgraph/standalone` images: # Build v20.03.4 make DGRAPH_VERSION=v20.03.4 make DGRAPH_VERSION=v20.03.4 push # Build latest. DGRAPH_VERSION defaults to latest make make push Changes * Add `DOCKER_IMAGE` and `DGRAPH_VERSION` arguments to build standalone Docker image. * Add ./hooks folder for Docker Hub auto-builds with `--build-arg`s (following [Custom build phase hooks](https://docs.docker.com/docker-hub/builds/advanced/#custom-build-phase-hooks) docs).
- Loading branch information
Showing
4 changed files
with
42 additions
and
16 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 |
---|---|---|
@@ -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 | ||
|
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -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 |
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,3 @@ | ||
#!/bin/bash | ||
# Used for Makefile or Docker Hub builds | ||
docker build -t dgraph/standalone:${DGRAPH_VERSION} --build-arg DGRAPH_VERSION=${DGRAPH_VERSION} . |