Answer the question
In order to leave comments, you need to log in
Through Docker, apt-get gives errors, why?
Ubuntu 16.04
I started to get acquainted with Docker, I make the first Dockerfile (commands in RUN work fine if you just type it into the console) -
FROM docker/whalesay:latest
RUN apt-get -y update && apt-get install -y fortunes
CMD /usr/games/fortune -a | cowsay
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/r/recode/librecode0_3.6-21_amd64.deb
Temporary failure resolving 'archive.ubuntu.com'
Err http://archive.ubuntu.com/ubuntu/ trusty/main librecode0 amd64 3.6-21
Temporary failure resolving 'archive.ubuntu.com'
Err http://archive.ubuntu.com/ubuntu/ trusty/universe fortune-mod amd64 1:1.99.1-7
Temporary failure resolving 'archive.ubuntu.com'
Err http://archive.ubuntu.com/ubuntu/ trusty/universe fortunes-min all 1:1.99.1-7
Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/trusty/InRelease
#Пингуется отлично
nameserver 127.0.1.1
DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4 --ip-masq=true"
Answer the question
In order to leave comments, you need to log in
You took the old, like ... but mammoth base image. Here is the Dockerfile:
FROM ubuntu:16.04
RUN apt update && apt install fortunes cowsay -y
CMD ["/usr/games/fortune", "-e"]
-e
, because I don't know how to push the pipe into CMD. CMD ["/bin/bash", "-c", "/usr/games/fortune -a | /usr/games/cowsay"]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question