-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Partners might have to run the CLI to export the public key (or generate it in the first place) and provide it to Ephemera for use in the `testnet`. It is not too convenient to download the repo, install go, just to run the CLI. Build a docker image instead. We will eventually need releases here in GH for easy download, and `homebrew` as well. The important question is. How should this binary be called? This should help @jhaaaa with docs.
- Loading branch information
Showing
4 changed files
with
52 additions
and
5 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
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
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 |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
|
||
set -eu | ||
|
||
go run cmd/cli/main.go "$@" | ||
go run -ldflags="-X main.Commit=$(git rev-parse HEAD)" cmd/cli/main.go "$@" |
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,28 @@ | ||
# BUILD IMAGE -------------------------------------------------------- | ||
ARG GO_VERSION=1.22 | ||
FROM golang:${GO_VERSION}-alpine AS builder | ||
|
||
# Get build tools and required header files | ||
RUN apk add --no-cache build-base | ||
|
||
WORKDIR /app | ||
COPY . . | ||
|
||
# Build the final node binary | ||
ARG GIT_COMMIT=unknown | ||
RUN go build -ldflags="-X 'main.Commit=$GIT_COMMIT'" -o bin/xmtpd-cli cmd/cli/main.go | ||
|
||
# ACTUAL IMAGE ------------------------------------------------------- | ||
|
||
FROM alpine:3.12 | ||
|
||
LABEL maintainer="[email protected]" | ||
LABEL source="https://github.com/xmtp/xmtpd" | ||
LABEL description="XMTPD CLI" | ||
|
||
# color, nocolor, json | ||
ENV GOLOG_LOG_FMT=nocolor | ||
|
||
COPY --from=builder /app/bin/xmtpd-cli /usr/bin/ | ||
|
||
ENTRYPOINT ["/usr/bin/xmtpd-cli"] |