When running the Dockerfile command in China, the source of apt has not been modified. It defaults to the official source of Ubuntu. If you pass it directly, it apt-get install
will be very slow or even fail. If you have used Ubuntu’s apt before, you should be very familiar with it
Edit the Dockerfile apt-get install
and change the source to Ali source:
RUN sed -i s@/archive.ubuntu.com/@/mirrors.aliyun.com/@g /etc/apt/sources.list
RUN apt-get update
....
....
....
RUN apt-get install -y xxxxxxx