|
12345678910111213141516171819202122232425262728293031323334353637 |
-
-
- FROM registry.cn-shenzhen.aliyuncs.com/fnuoos-prd/golang:1.18.4 as build
-
-
-
- ENV GO111MODULE=on
- ENV GOPROXY=https://goproxy.cn,direct
- ENV TZ="Asia/Shanghai"
-
- WORKDIR /go/release
-
-
- 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="dengbiao"
- ENV TZ="Asia/Shanghai"
-
- COPY static/html static/html
- COPY docs docs
-
-
- RUN rm -f /etc/localtime \
- && ln -sv /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
- && echo "Asia/Shanghai" > /etc/timezone
-
- COPY --from=build /go/release/zyos ./zyos
-
- COPY --from=build /go/release/etc/cfg.yml /var/zyos/cfg.yml
-
-
- CMD ["./zyos","-c","/var/zyos/cfg.yml"]
-
|