Walid Hanafy
Walid Hanafy

Reputation: 1607

Docker Ubuntu Build File Errors

I am building a docker Image using the following File

# 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

I keep getting the following error:

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 

Upvotes: 1

Views: 2575

Answers (2)

Steveo
Steveo

Reputation: 13

I added quiet and yes flags and it worked.

# 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'

If you're running it virtualise, try restarting the docker machine with docker-machine restart default (Run docker-machine ls to get name if default doesn't work). I found sometimes it can't connect to the internet for some reason and this fixes it.

Upvotes: 1

code_monk
code_monk

Reputation: 10128

You might be out of disk space. Try running these commands to clear up space:

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

Upvotes: 0

Related Questions