alpine 和 Debian 镜像更改源,及安装软件并删除缓存:

alpine:

sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && \
    apk update && \
    apk add --no-cache gcc 

Debian:

sed -i s@/deb.debian.org/@/mirrors.aliyun.com/@g /etc/apt/sources.list && \
    apt-get clean && apt-get update && \
    apt-get -y install gcc &&\
    apt-get autoclean && rm -rf /var/lib/apt/lists/*