dgraph Docker & Self-Hosted Deployment

GitHub

High-performance graph database for real-time use cases

21,771 stars Go Go 1 file ยท ~3,291 tokens #database#distributed#go#knowledge-graph
1. Pull Image (DOCKERHUB) docker pull dgraph-io/dgraph:latest
2. Docker Run (1-Click Launch) docker run -d --name dgraph --restart always dgraph-io/dgraph:latest
3. Podman Run podman run -d --name dgraph --restart always dgraph-io/dgraph:latest
4. Skopeo Inspect (Zero-Pull Manifest) skopeo inspect docker://docker.io/dgraph-io/dgraph:latest
5. ORAS Pull (OCI Artifact) oras pull dgraph-io/dgraph:latest
Dockerfile
# Used only by the (currently disabled) nightly build workflow

###################### Stage I ######################
FROM golang:1.27.3 AS builder
RUN apt-get update && apt-get install -y --no-install-recommends \
    bzip2=1.0.8-5+b1 \
    git=1:2.39.5-0+deb12u2 \
    && rm -rf /var/lib/apt/lists/*
ARG TARGETARCH=amd64
ARG TARGETOS=linux
WORKDIR /go/src/repo
COPY go.mod go.sum ./
RUN go mod download && go mod verify
COPY . .
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} make

###################### Stage II ######################
FROM ubuntu:24.04
LABEL maintainer="Dgraph <[email protected]>"
RUN apt-get update && apt-get install -y --no-install-recommends \
    ca-certificates=20240203 \
    curl=8.5.0-2ubuntu10.6 \
    htop=3.3.0-4build1 \
    iputils-ping=3:20240117-1build1 \
    jq=1.7.1-3ubuntu0.24.04.1 \
    less=590-2ubuntu2.1 \
    sysstat=12.6.1-2 \
    && rm -rf /var/lib/apt/lists/*
COPY --from=builder /go/src/repo/dgraph/dgraph /usr/local/bin/
COPY --from=builder /go/src/repo/contrib/standalone/run.sh /
RUN chmod +x /run.sh
WORKDIR /dgraph
ENV GODEBUG=madvdontneed=1
CMD ["/run.sh"]