在Dockerfile的RUN语句后加入一行
sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && \
例如
RUN set -ex && \
chmod a+x /usr/bin/entrypoint.sh && \
sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && \
apk add --no-cache \
--virtual .build-deps \
build-base \
curl \
openssl-dev \
tar && \
chmod a+x /usr/bin/entrypoint.sh && \
sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && \
apk add --no-cache \
--virtual .build-deps \
build-base \
curl \
openssl-dev \
tar && \
原创文章,转载请注明: 转载自混沌