1

我正在使用以下文件构建 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 
4

2 回答 2

1

我添加了 quiet 和 yes 标志,它起作用了。

# 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-machine ls以获取名称,如果默认值不起作用)重新启动 docker 机器。我发现有时它由于某种原因无法连接到互联网,这解决了它。

于 2015-12-30T05:31:53.630 回答
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
于 2015-12-30T05:13:27.807 回答