huangjiajun 2 months ago
parent
commit
780105bc5d
1 changed files with 2 additions and 5 deletions
  1. +2
    -5
      Dockerfile

+ 2
- 5
Dockerfile View File

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


# 容器环境变量添加,会覆盖默认的变量值 # 容器环境变量添加,会覆盖默认的变量值
ENV GO111MODULE=on ENV GO111MODULE=on
ENV GOPROXY=https://goproxy.cn,direct ENV GOPROXY=https://goproxy.cn,direct
ENV TZ="Asia/Shanghai" ENV TZ="Asia/Shanghai"
ENV PHONE_DATA_DIR="./static/bat"
# 设置工作区 # 设置工作区
WORKDIR /go/release WORKDIR /go/release


@@ -17,12 +16,10 @@ ADD . .
RUN GOOS=linux CGO_ENABLED=0 GOARCH=amd64 go build -tags netgo -ldflags="-s -w" -installsuffix cgo -o zyos main.go 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 FROM ubuntu:xenial as prod
LABEL maintainer="zengzhengrong"
LABEL maintainer="wuhanqin"
ENV TZ="Asia/Shanghai" ENV TZ="Asia/Shanghai"
ENV PHONE_DATA_DIR="./static/bat"


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


Loading…
Cancel
Save