Skip to content

Commit a240d2f

Browse files
committed
version tracking in dockerfile
1 parent 9368ad9 commit a240d2f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,18 @@ COPY . ./
1010
# Build the applications
1111
RUN go build -o /app/xrp-indexer ./cmd/indexer/main.go
1212

13+
RUN git describe --tags --always > PROJECT_VERSION && \
14+
date --iso-8601=seconds > PROJECT_BUILD_DATE && \
15+
git rev-parse HEAD > PROJECT_COMMIT_HASH
16+
1317
FROM debian:latest AS execution
1418

1519
WORKDIR /app
1620

1721
COPY --from=builder /app/xrp-indexer .
1822
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
23+
COPY --from=builder /build/PROJECT_VERSION .
24+
COPY --from=builder /build/PROJECT_BUILD_DATE .
25+
COPY --from=builder /build/PROJECT_COMMIT_HASH .
1926

2027
CMD ["./xrp-indexer"]

0 commit comments

Comments
 (0)