apt-getuqdateが遅すぎるという問題を解決します

apt-getuqdateが遅すぎるという問題を解決します

Dockerfileファイルでは、このコード行を確認できます。

RUN apt-get update && \
  apt-get install -q -y default-jdk

展開の過程で、このコードを実行すると特に速度が遅くなることがわかったので、次の方法で速度が遅すぎるという問題を解決しました。

コードの前にこれらのコード行を追加しました。これらはソースの構成に使用されます

ADD sources.list /etc/apt/
RUN  apt-get clean
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32
RUN apt-get update && \
  apt-get install -q -y default-jdk

前の手順を完了したら、プロジェクトディレクトリにsources.listファイルを作成し、次のコード行を記述する必要があります。

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

上記はAliyuanです。

おすすめ

転載: blog.csdn.net/weixin_43372169/article/details/110200946