Skip to content

Commit 23008dd

Browse files
authored
indexer-alt-graphql dockerfile (#22027)
## Description Create Dockerfile for sui-indexer-alt-graphql ## Test plan How did you test the new or updated feature? --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] gRPC: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK:
1 parent 4141db9 commit 23008dd

File tree

2 files changed

+63
-0
lines changed

2 files changed

+63
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Build application
2+
#
3+
# Copy in all crates, Cargo.toml and Cargo.lock unmodified,
4+
# and build the application.
5+
# rust:1.85-bullseye
6+
FROM rust@sha256:033a8da97a1e4d53d51fcef8f8eefaba69ff2208fbee583c4ea84f704b307db2 AS builder
7+
ARG PROFILE=release
8+
ARG GIT_REVISION
9+
ENV GIT_REVISION=$GIT_REVISION
10+
WORKDIR "$WORKDIR/sui"
11+
12+
# sui-indexer need ca-certificates
13+
RUN apt update && apt install -y ca-certificates postgresql
14+
15+
RUN apt-get update && apt-get install -y cmake clang
16+
17+
COPY Cargo.toml Cargo.lock ./
18+
COPY consensus consensus
19+
COPY crates crates
20+
COPY sui-execution sui-execution
21+
COPY external-crates external-crates
22+
23+
RUN cargo build --profile ${PROFILE} --bin sui-indexer-alt-graphql
24+
25+
# Production Image
26+
# debian:bullseye-slim
27+
FROM debian@sha256:fdd75562fdcde1039c2480a1ea1cd2cf03b18b6e4cb551cabb03bde66ade8a5d AS runtime
28+
# Use jemalloc as memory allocator
29+
RUN apt-get update && apt-get install -y libjemalloc-dev ca-certificates curl
30+
ENV LD_PRELOAD /usr/lib/x86_64-linux-gnu/libjemalloc.so
31+
WORKDIR "$WORKDIR/sui"
32+
COPY --from=builder /sui/target/release/sui-indexer-alt-graphql /usr/local/bin
33+
RUN apt update && apt install -y ca-certificates postgresql
34+
35+
ARG BUILD_DATE
36+
ARG GIT_REVISION
37+
LABEL build-date=$BUILD_DATE
38+
LABEL git-revision=$GIT_REVISION
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/sh
2+
# Copyright (c) Mysten Labs, Inc.
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
# fast fail.
6+
set -e
7+
8+
DIR="$( cd "$( dirname "$0" )" && pwd )"
9+
REPO_ROOT="$(git rev-parse --show-toplevel)"
10+
DOCKERFILE="$DIR/Dockerfile"
11+
GIT_REVISION="$(git describe --always --abbrev=12 --dirty --exclude '*')"
12+
BUILD_DATE="$(date -u +'%Y-%m-%d')"
13+
14+
echo
15+
echo "Building sui-indexer-alt-graphql docker image"
16+
echo "Dockerfile: \t$DOCKERFILE"
17+
echo "docker context: $REPO_ROOT"
18+
echo "build date: \t$BUILD_DATE"
19+
echo "git revision: \t$GIT_REVISION"
20+
echo
21+
22+
docker build -f "$DOCKERFILE" "$REPO_ROOT" \
23+
--build-arg GIT_REVISION="$GIT_REVISION" \
24+
--build-arg BUILD_DATE="$BUILD_DATE" \
25+
"$@"

0 commit comments

Comments
 (0)