forked from caoyingjunz/pixiu
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add version sub command to server app (caoyingjunz#357)
- Loading branch information
1 parent
1862ce5
commit 735c855
Showing
5 changed files
with
29 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
FROM golang:1.17-alpine as builder | ||
WORKDIR /app | ||
ARG VERSION | ||
ENV GOPROXY=https://goproxy.cn | ||
COPY ./go.mod ./ | ||
COPY ./go.sum ./ | ||
#RUN go mod download | ||
COPY . . | ||
RUN CGO_ENABLED=0 go build -ldflags "-s -w" -o pixiu ./cmd | ||
RUN CGO_ENABLED=0 go build -ldflags "-s -w -X 'main.version=${VERSION}'" -o pixiu ./cmd | ||
|
||
FROM busybox as runner | ||
COPY --from=builder /app/pixiu /app | ||
ENTRYPOINT ["/app"] | ||
ENTRYPOINT ["/app"] |
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