更新 DockerfileSlim

This commit is contained in:
耿阳 2025-02-22 09:05:44 +00:00
parent 58131f934f
commit d151a87c5d

View File

@ -1,22 +1,18 @@
FROM testhub.szjixun.cn:9043/public/golang:1.20-alpine AS builder FROM busybox:glibc
LABEL stage=gobuilder COPY ./docs/Shanghai /usr/share/zoneinfo/Asia/Shanghai
ENV CGO_ENABLED 0 COPY ./docs/certs /etc/ssl/certs
ENV GOPROXY https://goproxy.cn,direct RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone
WORKDIR /build
COPY micro-bundle /app/micro-bundle
#FROM 172.16.100.99:9006/alpine #ENV TZ Asia/Shanghai
#RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories ARG GIT_COMMIT=default_value
#RUN apk update --no-cache ENV GIT_COMMIT=$GIT_COMMIT
#RUN apk add --no-cache ca-certificates
#RUN apk add --no-cache tzdata
FROM testhub.szjixun.cn:9043/public/self-alpine
COPY ./conf /app/conf
ENV TZ Asia/Shanghai WORKDIR /app/main-client
ENV MODE_ENV k8stest #通过名称引用
WORKDIR /app COPY ./build/app ./bin/mainServer
COPY --from=builder /app/micro-bundle . COPY ./conf/ /app/conf/
EXPOSE 20118 COPY ./conf/ ./conf/
CMD ["/app/micro-bundle"]
WORKDIR /app/main-client/bin
CMD ["./mainServer"]