Docker RUN apt-get -y update && apt-get install -y fortune
试图build立我自己的docker,有一个小问题,这里是我在跟随在Docker的教程的日志。
FROM docker/whalesay:lateset RUN apt-get -y update && apt-get install -y fortunes CMD /usr/games/fortune -a | cowsay
运行apt-get后发生这种情况…
W: Size of file /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_trusty_universe_source_Sources.gz is not what the server reported 213537 7925687 W: Size of file /var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_trusty_universe_binary-amd64_Packages.gz is not what the server reported 11688 7588885 W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-updates/main/source/Sources Hash Sum mismatch W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-updates/restricted/source/Sources Hash Sum mismatch W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-updates/main/binary-amd64/Packages Hash Sum mismatch W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-updates/restricted/binary-amd64/Packages Hash Sum mismatch W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-updates/universe/binary-amd64/Packages Hash Sum mismatch W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-security/main/source/Sources Hash Sum mismatch W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-security/restricted/source/Sources Hash Sum mismatch W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-security/universe/source/Sources Hash Sum mismatch W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-security/main/binary-amd64/Packages Hash Sum mismatch W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-security/restricted/binary-amd64/Packages Hash Sum mismatch W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty-security/universe/binary-amd64/Packages Hash Sum mismatch W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty/universe/source/Sources Hash Sum mismatch W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty/universe/binary-amd64/Packages Hash Sum mismatch E: Some index files failed to download. They have been ignored, or old ones used instead.
在apt-get update
之前运行这个命令:
sudo rm -rf /var/lib/apt/lists/*
你的空间已经用完了 或者更确切地说,超过了专门用于docker资产的空间。
试试这个(在主机上):
$ docker rmi $(docker images -q)
或者这个: https : //hub.docker.com/r/martin/docker-cleanup-volumes/
在apt-get update
之前添加apt-get clean
apt-get update
解决我的问题。 你可以尝试一下。
Dockerfile应该如下所示:
FROM docker/whalesay:latest RUN apt-get clean && apt-get -y update && apt-get install -y fortunes CMD /usr/games/fortune -a | cowsay
- 在docker容器中安装openssh-server,g ++,gdb和gdbserver Visual C ++ for Linux Development + Docker
- 为什么apt-get更新在Docker容器内失败?
- Docker Debian apt从服务器读取错误
- apt-get在基于Debian和Ubuntu的Docker镜像中失败
- 将软件包安装到ubuntu14.04 docker容器中
- 使用apt-get build depm最小化Docker镜像
- 在dockerfile中绕过安assembly置
- 来自debian的docker:wheezy不能构build
- 在Docker中,Debian httpredir镜像系统不可靠/不可用?