Docker Ubuntu构建文件错误

时间:2015-12-30 03:55:39

标签: ubuntu docker docker-build

我正在使用以下文件

构建一个docker Image
# Version: 0.0.1
FROM ubuntu
MAINTAINER Walid Ashraf
RUN apt-get update
RUN apt-get upgrade
RUN apt-get install -y git libprotobuf-dev libprotobuf-c0-dev protobuf-c-compiler protobuf-compiler python-protobuf

我一直收到以下错误:

Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package libprotobuf-c0-dev
E: Unable to locate package protobuf-c-compiler
E: Unable to locate package python-protobuf
The command '/bin/sh -c apt-get install -y git libprotobuf-dev libprotobuf-c0-dev protobuf-c-compiler protobuf-compiler python-protobuf' returned a non-zero code: 100 

2 个答案:

答案 0 :(得分:0)

您可能没有磁盘空间。尝试运行这些命令来清理空间:

docker rm -v $(docker ps -a -q -f status=exited) # remove unused containers
docker rmi $(docker images -q -f dangling=true) # remove unused images
docker run -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker:/var/lib/docker --rm martin/docker-cleanup-volumes # remove unused volumes

答案 1 :(得分:0)

我添加了安静和是的标志,它有效。

# Version: 0.0.1
FROM ubuntu
MAINTAINER Walid Ashraf
RUN apt-get update -q
RUN apt-get upgrade -y
RUN apt-get install -y git libprotobuf-dev libprotobuf-c0-dev protobuf-c-compiler protobuf-compiler python-protobuf'

如果您正在运行虚拟化,请尝试使用docker-machine restart default重新启动docker计算机(如果默认设置不起作用,请运行docker-machine ls以获取名称)。我发现有时由于某种原因它无法连接到互联网,这解决了它。