更新 DockerfileSlim

This commit is contained in:
耿阳 2025-02-24 14:52:01 +00:00
parent 7f9b726f21
commit 65849e6329

View File

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