Skip to content

Commit

Permalink
build: vcs stamping
Browse files Browse the repository at this point in the history
  • Loading branch information
csdev committed Apr 27, 2023
1 parent 39e2eda commit 81d2cd1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
.git/
5 changes: 3 additions & 2 deletions build/prod/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@ FROM golang:1.19-alpine AS builder

ARG SERVICE=go

RUN apk add --no-cache gcc musl-dev pkgconf
RUN apk add --no-cache gcc git musl-dev pkgconf

WORKDIR /opt/$SERVICE
COPY go.mod go.sum ./
RUN go mod download && go mod verify

COPY . .
RUN mkdir "/opt/$SERVICE/bin" \
&& go build -ldflags "-linkmode 'external' -extldflags '-static'" -o "/opt/$SERVICE/bin" -v ./...
&& go build -ldflags "-linkmode 'external' -extldflags '-static'" \
-buildvcs=true -o "/opt/$SERVICE/bin" -v ./...

FROM alpine:latest

Expand Down

0 comments on commit 81d2cd1

Please sign in to comment.