実現したいこと
Dockerでubuntu・pythonを導入した環境を構築したいです。
【環境】
Windows10
Docker Desktop 4.28.0
発生している問題・分からないこと
「docker build -t myapp:1.0 .」を実行するとエラーが出てしまい、イメージが作成できません。
数ヶ月前は普通にできていたので、なぜできなくなったのかが、不明です。
また、PaasサービスであるRailwayでのビルドはうまく行くようなので、ローカルのみおかしいようです。
当方、初心者のためわからない事が多く(特にDocker関連)初心者でもわかるように教えていただけると幸いです。。。
エラーメッセージ
error
1なぜか、下記の二通りのエラーがランダムに出ます(条件は変えなくても) 2 3ーーーーパターン1ーーーー 4385.8 Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/liba/libauthen-sasl-perl/libauthen-sasl-perl_2.1600-1_all.deb 403 connecting to archive.ubuntu.com:80: connecting to 91.189.91.82:80: dial 5tcp 91.189.91.82:80: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. [IP: 185.125.190.36 80] 6385.8 E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing? 7------ 8-------------------- 9 13 | #install google-chrome 10 14 | >>> RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add && \ 11t/sources.list.d/google-chrome.list && \ 12 16 | >>> apt-get update && \ 13 17 | >>> apt-get install -y google-chrome-stable 14 18 | 15-------------------- 16ERROR: failed to solve: process "/bin/sh -c wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add && echo 'deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main' | tee /etc/apt/sources.list.d/google-chrome.list && apt-get update && apt-get install -y google-chrome-stable" did not complete successfully: exit code: 100 17ーーーーーーーーーーーーー 18 19 20 21ーーーーパターン2ーーーー 22205.4 E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/n/npth/libnpth0_1.6-1_amd64.deb 403 connecting to archive.ubuntu.com:80: connecting to 91.189.91.81:80: dial tcp 91.189.91.81:80: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. [IP: 185.125.190.205.4 E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing? 23205.4 Fetched 71.6 MB in 3min 22s (355 kB/s) 24------ 25Dockerfile:8 26-------------------- 27 6 | RUN apt upgrade -y 28 7 | RUN apt install -y python3.9 29 8 | >>> RUN apt install -y python3-pip 30 9 | RUN apt install -y wget 31 10 | 32ERROR: failed to solve: process "/bin/sh -c apt install -y python3-pip" did not complete successfully: 33exit code: 100 34ーーーーーーーーーーーーー
該当のソースコード
Dockerfile
1FROM ubuntu:focal 2USER root 3 4RUN apt update 5RUN apt upgrade -y 6RUN apt install -y python3.9 7RUN apt install -y python3-pip 8RUN apt install -y wget 9 10RUN apt-get update && apt-get install -y unzip 11 12#install google-chrome 13RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add && \ 14 echo 'deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main' | tee /etc/apt/sources.list.d/google-chrome.list && \ 15 apt-get update && \ 16 apt-get install -y google-chrome-stable 17 18 19#install ChromeDriver 20# バージョン指定あり 21ADD https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.96/linux64/chrome-linux64.zip /opt/chrome/ 22RUN cd /opt/chrome/ && \ 23 unzip chrome-linux64.zip 24 25ENV PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/chrome 26 27COPY requirements.txt . 28RUN python3.9 -m pip install -r requirements.txt 29 30WORKDIR /var 31 32COPY script.py . 33COPY settings.yaml . 34 35ENTRYPOINT ["python3.9", "script.py"]
試したこと・調べたこと
- teratailやGoogle等で検索した
- ソースコードを自分なりに変更した
- 知人に聞いた
- その他
上記の詳細・結果
・Docker Desktopのバージョンアップ
・Docker Desktopの再インストール
・PCの再起動
・ChatGPT4などに質問
・(残量が少なかったので)HDDを100GB以上開ける
・「docker builder prune -f」でキャッシュ削除
⇒問題変わらず
補足
特になし

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。