This commit is contained in:
Mac Chiang
2019-12-18 12:35:44 +08:00
parent 43510e18e2
commit f9f5c278ec
6 changed files with 44 additions and 3 deletions

12
cli/Dockerfile Normal file
View File

@@ -0,0 +1,12 @@
# build stage
FROM golang:alpine AS build-env
RUN set -eux; \
apk add --no-cache --virtual .build-deps \
git gcc libc-dev;
ENV GO111MODULE on
WORKDIR /go/main
ADD go.mod go.sum ./
RUN go mod download
# WORKDIR /go/src/status-monitor
ADD main.go ./
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -a -installsuffix cgo -o main main.go