forked from mata-elang-stable/report-command-service
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (18 loc) · 650 Bytes
/
Dockerfile
File metadata and controls
31 lines (18 loc) · 650 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
ARG GO_VERSION=1.23
FROM golang:${GO_VERSION}-alpine AS build
ARG APP_NAME="report-command"
ARG APP_VERSION="dev"
ARG APP_COMMIT="none"
RUN apk add --no-cache librdkafka-dev pkgconf build-base musl-dev
WORKDIR /go/src/app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
ENV CGO_ENABLED=1
ENV GOOS=linux
ENV GO111MODULE=on
RUN go build -ldflags "-X main.appVersion=${APP_VERSION} -X main.appCommit=${APP_COMMIT} -X main.appLicense=${APP_LICENSE}" -tags dynamic -tags musl -o /go/bin/app ./cmd/report
FROM golang:${GO_VERSION}-alpine
RUN apk add --no-cache librdkafka
COPY --from=build /go/bin/app /go/bin/app
ENTRYPOINT ["/go/bin/app"]