Skip to content

Commit

Permalink
Fix docker build and new version
Browse files Browse the repository at this point in the history
  • Loading branch information
shayonj committed Nov 3, 2024
1 parent 087c113 commit 6288dce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ COPY . .
ARG VERSION=dev
ARG COMMIT=none
ARG DATE=unknown
RUN go build -v -ldflags="-s -w -X github.com/shayonj/pg_flo/cmd.version=${VERSION} -X github.com/shayonj/pg_flo/cmd.commit=${COMMIT} -X github.com/shayonj/pg_flo/cmd.date=${DATE}" -o pg_flo .
RUN CGO_ENABLED=0 GOOS=linux go build -v \
-ldflags '-s -w \
-X "github.com/shayonj/pg_flo/cmd.version=${VERSION}" \
-X "github.com/shayonj/pg_flo/cmd.commit=${COMMIT}" \
-X "github.com/shayonj/pg_flo/cmd.date=${DATE}"' \
-o pg_flo .

FROM alpine:latest
COPY --from=builder /app/pg_flo /usr/local/bin/
Expand Down
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func init() {
versionCmd := &cobra.Command{
Use: "version",
Short: "Print version information",
Run: func(cmd *cobra.Command, args []string) {
Run: func(_ *cobra.Command, _ []string) {
fmt.Printf("pg_flo version %s\n", formatVersion())
},
}
Expand Down

0 comments on commit 6288dce

Please sign in to comment.