Dockerfile: 使用阿里云镜像源加速构建 Golang 镜像
FROM --platform=$BUILDPLATFORM ${GOLANG_IMAGE} AS base
COPY --from=xx / /
RUN echo 'Binary::apt::APT::Keep-Downloaded-Packages 'true';' > /etc/apt/apt.conf.d/keep-cache
ARG APT_MIRROR
RUN sed -ri 's/(httpredir|deb).debian.org/${APT_MIRROR:-mirrors.aliyun.com}/g' /etc/apt/sources.list
&& sed -ri 's/(security).debian.org/${APT_MIRROR:-mirrors.aliyun.com}/g' /etc/apt/sources.list
ARG DEBIAN_FRONTEND
RUN apt-get update && apt-get install --no-install-recommends -y file
ENV GO111MODULE=off
原文地址: https://www.cveoy.top/t/topic/gT4x 著作权归作者所有。请勿转载和采集!