huangjiajun há 1 ano
ascendente
cometimento
560735867b
1 ficheiros alterados com 4 adições e 5 eliminações
  1. +4
    -5
      Dockerfile

+ 4
- 5
Dockerfile Ver ficheiro

@@ -1,10 +1,10 @@
# 多重构建,减少镜像大小
# 构建:使用golang:1.15版本
# 构建:使用golang:1.13版本
FROM registry.cn-shenzhen.aliyuncs.com/fnuoos-prd/golang:1.18.4 as build

# 容器环境变量添加,会覆盖默认的变量值
ENV GO111MODULE=on
ENV GOPROXY=https://goproxy.cn,direct
#ENV GO111MODULE=on
ENV GOPROXY=https://proxy.golang.com.cn,direct
ENV TZ="Asia/Shanghai"
# 设置工作区
WORKDIR /go/release
@@ -16,10 +16,9 @@ ADD . .
RUN GOOS=linux CGO_ENABLED=0 GOARCH=amd64 go build -tags netgo -ldflags="-s -w" -installsuffix cgo -o zyos main.go

FROM ubuntu:xenial as prod
LABEL maintainer="wuhanqin"
LABEL maintainer="sherlockwhite"
ENV TZ="Asia/Shanghai"

COPY static/html static/html
# 时区纠正
RUN rm -f /etc/localtime \
&& ln -sv /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \


Carregando…
Cancelar
Guardar