开发者社区> 问答> 正文

使用阿里云的debian源构建镜像报错

我想使用docker-compose构建一个镜像,镜像基于python3.8,makefile中为更新源并且apt update 和安装apt install -y gettext。当我执行docker-compose时,报了以下错误

Step 1/2 : FROM python:3.8
 ---> 3189819ced3e
Step 2/2 : RUN echo 'deb http://mirrors.aliyun.com/debian/ buster main non-free contrib\n     deb-src http://mirrors.aliyun.com/debian/ buster main non-free contrib\n     deb http://mirrors.aliyun.com/debian-security buster/updates main\n     deb-src http://mirrors.aliyun.com/debian-security buster/updates main\n     deb http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib\n     deb-src http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib\n     deb http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib\n     deb-src http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib\n'     > /etc/apt/sources.list && apt update && apt install -y gettext
 ---> Running in 210bbe8b7216

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Get:1 http://mirrors.aliyun.com/debian buster InRelease [121 kB]
Get:2 http://mirrors.aliyun.com/debian-security buster/updates InRelease [65.4 kB]
Get:3 http://mirrors.aliyun.com/debian buster-updates InRelease [51.9 kB]
Get:4 http://mirrors.aliyun.com/debian buster-backports InRelease [46.7 kB]
Get:5 http://mirrors.aliyun.com/debian buster/main Sources [7831 kB]
Get:6 http://mirrors.aliyun.com/debian buster/non-free Sources [85.9 kB]
Get:7 http://mirrors.aliyun.com/debian buster/contrib Sources [43.1 kB]
Get:8 http://mirrors.aliyun.com/debian buster/main amd64 Packages [7905 kB]
Get:9 http://mirrors.aliyun.com/debian buster/contrib amd64 Packages [51.0 kB]
Get:10 http://mirrors.aliyun.com/debian buster/non-free amd64 Packages [87.7 kB]
Get:11 http://mirrors.aliyun.com/debian-security buster/updates/main Sources [131 kB]
Get:12 http://mirrors.aliyun.com/debian-security buster/updates/main amd64 Packages [213 kB]
Get:13 http://mirrors.aliyun.com/debian buster-updates/non-free Sources [716 B]
Get:14 http://mirrors.aliyun.com/debian buster-updates/main Sources [3716 B]
Get:15 http://mirrors.aliyun.com/debian buster-updates/main amd64 Packages [7868 B]
Get:16 http://mirrors.aliyun.com/debian buster-updates/non-free amd64 Packages [604 B]
Get:17 http://mirrors.aliyun.com/debian buster-backports/main Sources [301 kB]
Get:18 http://mirrors.aliyun.com/debian buster-backports/non-free Sources [7036 B]
Get:19 http://mirrors.aliyun.com/debian buster-backports/contrib Sources [4536 B]
Get:20 http://mirrors.aliyun.com/debian buster-backports/non-free amd64 Packages [23.8 kB]
Get:21 http://mirrors.aliyun.com/debian buster-backports/contrib amd64 Packages [7652 B]
Ign:22 http://mirrors.aliyun.com/debian buster-backports/main amd64 Packages
Get:22 http://mirrors.aliyun.com/debian buster-backports/main amd64 Packages [341 kB]
Err:22 http://mirrors.aliyun.com/debian buster-backports/main amd64 Packages
  File has unexpected size (340772 != 340836). Mirror sync in progress? [IP: 118.116.3.240 80]
  Hashes of expected file:
   - Filesize:340836 [weak]
   - SHA256:c5c1085ac286f0469391d2f673d98b92953c7b05ad150e0836a940d1564a4e41
  Release file created at: Wed, 22 Jul 2020 14:13:49 +0000
Fetched 17.0 MB in 4s (4160 kB/s)
Reading package lists...
E: Failed to fetch http://mirrors.aliyun.com/debian/dists/buster-backports/main/binary-amd64/Packages.xz  File has unexpected size (340772 != 340836). Mirror sync in progress? [IP: 118.116.3.240 80]
   Hashes of expected file:
    - Filesize:340836 [weak]
    - SHA256:c5c1085ac286f0469391d2f673d98b92953c7b05ad150e0836a940d1564a4e41
   Release file created at: Wed, 22 Jul 2020 14:13:49 +0000
E: Some index files failed to download. They have been ignored, or old ones used instead.
ERROR: Service 'shiyanlou' failed to build: The command '/bin/sh -c echo 'deb http://mirrors.aliyun.com/debian/ buster main non-free contrib\n     deb-src http://mirrors.aliyun.com/debian/ buster main non-free contrib\n     deb http://mirrors.aliyun.com/debian-security buster/updates main\n     deb-src http://mirrors.aliyun.com/debian-security buster/updates main\n     deb http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib\n     deb-src http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib\n     deb http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib\n     deb-src http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib\n'     > /etc/apt/sources.list && apt update && apt install -y gettext' returned a non-zero code: 100

github上似乎有人遇到同样的问题,但是是官方镜像源出问题了。add-apt-repository failed due to "File has unexpected size",有人知道该怎么弄吗?是不是阿里云的镜像源同步出问题了,需要回滚??

展开
收起
游客skqlbh3hzdzzy 2020-07-23 11:17:29 3477 0
0 条回答
写回答
取消 提交回答
问答排行榜
最热
最新

相关电子书

更多
Debian GNU/Linux 安全合规之路 立即下载
Docker 镜像原理和最佳实践 立即下载
Docker镜像原理和最佳实践 立即下载