If I have a few RUN
commands in my Dockerfile, how can I have it not print any output from a specific command, such as ignoring the printed statements from an apt-get update
?
Asked
Active
Viewed 8,505 times
2

cclloyd
- 8,171
- 16
- 57
- 104
1 Answers
4
This works for me
FROM ubuntu:16.04
RUN which nano || echo no nano
RUN bash -c "apt-get update &> /dev/null"
RUN bash -c "apt-get install nano &> /dev/null"
RUN which nano
(really got the solution from Redirecting command output in docker)

Alex028502
- 3,486
- 2
- 23
- 50