2016-05-08 9 views
1

Als ich bin mit dem Build-Befehl suchen:Docker Fehler Unable Paket cowsay

$ docker build -t cowsay . 
Sending build context to Docker daemon 3.072 kB 
Step 1 : FROM 
Unknown instruction: FROM 
[email protected]:~/cowsay$ docker build -t cowsay . 
Sending build context to Docker daemon 3.072 kB 
Step 1 : FROM ubuntu:14.04 
---> 90d5884b1ee0 
Step 2 : RUN apt-get -y install cowsay 
---> Running in 587aaba2824b 
Reading package lists... 
Building dependency tree... 
Reading state information... 
E: Unable to locate package cowsay 
The command '/bin/sh -c apt-get -y install cowsay' returned a non-zero code: 100 

Inhalt von Dockerfile ist wie folgt:

FROM ubuntu:14.04 
RUN apt-get -y install cowsay 
RUN apt-get -y install fortune 
ENTRYPOINT ["/usr/games/cowsay"] 
CMD ["Docker is so awesomoooooooo!"] 
ONBUILD RUN /usr/games/fortune | /usr/games/cowsay 

Wie kann ich vermeiden, diese Fehlermeldung?

Antwort

0

Versuchen Sie zuerst RUN apt-get update hinzuzufügen.

Sobald die Pakete aktualisiert sind, können Sie zum Beispiel cowsay installieren.

Siehe zum Beispiel this Dockerfile als Beispiel für RUN apt-get Befehle:

FROM debian:jessie 

RUN apt-get update && apt-get install -y cowsay 
COPY docker.cow /usr/share/cowsay/cows/docker.cow 

ENTRYPOINT ["/usr/games/cowsay","-f","docker"] 
CMD ["moby","dock"]