Press "Enter" to skip to content

docker 国内环境 构建慢,加速办法

Ubuntu更新或者按照包的时候,使用国内加速源

添加文件 sources.list

#163源
deb http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse

dockerfile 更新之前 添加


ADD sources.list /etc/apt/
RUN export DEBIAN_FRONTEND=noninteractive

apt 命令后面 需要加 –allow-unauthenticated

RUN apt-get update;apt-get install -y git bash --allow-unauthenticated
发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注