From e587605cbd7b9b83f6a3bd4101c05a747847867f Mon Sep 17 00:00:00 2001 From: sunyue Date: Thu, 17 Aug 2023 05:34:03 +0000 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20'gowork/dockerfile=5Fapi'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gowork/dockerfile_api | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 gowork/dockerfile_api diff --git a/gowork/dockerfile_api b/gowork/dockerfile_api new file mode 100644 index 0000000..88140a0 --- /dev/null +++ b/gowork/dockerfile_api @@ -0,0 +1,19 @@ +FROM registry.cn-hangzhou.aliyuncs.com/fs-devops/golang:2.22-06-22 + +WORKDIR /app/ +COPY . . +RUN unset GOPROXY +RUN go env -w GOPROXY=https://goproxy.cn +RUN go env -w GO111MODULE=on +RUN CGO_ENABLED=0 go build -ldflags "-extldflags -static " -tags netgo -a -v -o missionBoard main.go + + +FROM repository.anxinyun.cn/devops/alpine:3-tz-hw +RUN apk update && apk add tzdata +WORKDIR /usr/local/bin +COPY --from=0 /app/conf.ini /usr/local/bin +COPY --from=0 /app/missionBoard /usr/local/bin +EXPOSE 8080 +RUN chmod +x /usr/local/bin/missionBoard + +CMD ["missionBoard"] \ No newline at end of file