1

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?

cclloyd
  • 6,713
  • 15
  • 52
  • 84

1 Answers1

3

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,158
  • 2
  • 18
  • 40