📅  最后修改于: 2023-12-03 15:30:31.392000             🧑  作者: Mango
Docker build is a command used to build an image from a Dockerfile. The command provides the ability to build an image and create a container to run the application.
When building a Docker image, it can be useful to suppress the output of the Docker build command. This can help to reduce clutter and make it easier to focus on any errors that occur during the build process.
To suppress the output of a Docker build command, you can add the --quiet
or -q
flag.
docker build -q .
This will only output the image ID once the build process is complete. All other output will be suppressed.
In addition to suppressing the output in the console, you can also use the Dockerfile instruction RUN
with the --quiet
flag to suppress the output of any commands run during the build process.
RUN apt-get update -qq && \
apt-get install -yqq curl && \
curl -sSL https://get.docker.com/ | sh
The -qq
or --quiet
flag for apt-get
and the -sSL
flag for curl
suppress the output of these commands.
By suppressing the build output, you can make the build process less distracting and more focused on any errors that may occur.