作者 yangfu

Dockerfile 构建修改

正在显示 1 个修改的文件 包含 5 行增加1 行删除
... ... @@ -13,7 +13,11 @@ RUN go mod tidy
RUN GOOS=linux CGO_ENABLED=0 go build -ldflags="-s -w" -o godevp .
FROM alpine:latest
RUN ["ln","-sf","/usr/share/zoneinfo/Asia/Shanghai","/etc/localtime"]
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories \
&& apk add --no-cache tzdata \
&& ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& echo "Asia/Shanghai" > /etc/timezone \
&& rm -rf /var/cache/apk/* /tmp/* /var/tmp/* $HOME/.cache ## 清除缓存
WORKDIR /root/
COPY --from=builder /go/src/godevp .
EXPOSE 8082
... ...