dockerfiles/golang-builder/Dockerfile

14 lines
513 B
Docker
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

FROM golang:1.17.2-alpine
LABEL org.opencontainers.image.authors="lxh@cxh.cn"
# 修改alpine源为中科大的源安装必要工具
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories && \
apk update && \
apk upgrade && \
apk add --no-cache ca-certificates gcc g++ && update-ca-certificates && \
apk add --no-cache --update tzdata && \
rm -rf /var/cache/apk/*
ENV TZ=Asia/Shanghai
# 修改源
RUN go env -w GO111MODULE=on && go env -w GOPROXY=https://goproxy.cn,direct